# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 0
n 0(None)[Container.__init__(self)
self.style_dict = dict(font_style='font=Vera font_size=18', text_color=(255, 255, 255, 255), text_size=('100%', '100%'), selected_font_style='font=Vera font_size=20', selected_text_color=(255, 255, 255, 255), selected_text_size=('100%', '100%'), unsensitive_font_style='font=Vera font_size=18', unsensitive_text_color=(255, 255, 255, 255), unsensitive_text_size=('100%', '100%'), repository='', icon_size=('100%', '100%'), selected_icon_size=('100%', '100%'), unsensitive_icon_size=('100%', '100%'), item_size=('100%', '100%'), selected_item_size=('100%', '100%'), progress_bar_background='', progress_bar_foreground='', progress_bar_offset=('0%', '0%'), progress_bar_size=('5%', '100%'), rec_icon='', rec_icon_offset=('75%', '0%'), time_offset=('5%', '0%'), time_font_style='font=Gill font_size=20 align=left', time_color=(128, 0, 64, 255), title_font_style='font=Gill font_size=20 align=left wrap=char', title_color=(128, 128, 128, 255), selected_time_font_style='font=Gill font_size=24 align=left', selected_time_color=(255, 0, 128, 255), selected_title_font_style='font=Gill font_size=24 align=left wrap=char', selected_title_color=(255, 255, 255, 255), selected_blurb_time_font_style='font=Gill font_size=24 align=left', selected_blurb_time_color=(255, 0, 128, 255), selected_blurb_title_font_style='font=Gill font_size=24 align=left wrap=char', selected_blurb_title_color=(255, 255, 255, 255), selected_blurb_text_offset=('0%', '14%'), selected_blurb_offset=('-2%', '1%'), selected_blurb_zoom='110%', selection_cursor_image='', preserve_icon_aspect=0, preserve_icon_size=0, marker_image=None, selected_marker_image=None, marker_offset=('0%', '0%'), marker_size=('100%', '10%'), centered=False, text_offset=('0%', '4%'), selected_text_offset=('0%', '14%'), enumerated=False, edit_offset=20, duration=1, opacity=255, maxlen=20, extension=('png',), autoscroll=True, page_jump='reset', pos_policy='position', fade_pre_post=True)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7514aac>}
nname: 0
n 0(None)[self.style_dict.update(kwargs)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523c8c>}
nname: 0
n 0(None)[self.positions_list = positions
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523cec>}
nname: 0
n 0(None)[self._selected = selected_item
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523c4c>}
nname: 0
n 0(None)[self._centered = centered
self.style_dict['centered'] = centered
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523bcc>}
nname: 0
n 0(None)[self.duration = duration
self.style_dict['duration'] = duration
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523c0c>}
nname: 0
n 0(None)[self._bar = self.get_obj_by_name(bar)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523d4c>}
nname: 0
n 0(None)[self.repository = repository
self.style_dict['repository'] = repository
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523c2c>}
nname: 52
n 52(None)[return None
]:
	i: 38(), 51()
	o: 

nname: 51
n 51(None)[]:
	i: 26(f)
	o: 52()

nname: 38
n 38(None)[self.post_position = post_position
]:
	i: 26(t)
	o: 52()

nname: 26
n 26(post_position is not None)[]:
	i: 12(), 25()
	o: 38(t), 51(f)

nname: 25
n 25(None)[]:
	i: 0(f)
	o: 26()

nname: 12
n 12(None)[self.pre_position = pre_position
]:
	i: 0(t)
	o: 26()

nname: 0
n 0(pre_position is not None)[]:
	i: 
	o: 12(t), 25(f)

nname: 52
n 52(None)[return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if pre_position is not None:
	self.pre_position = pre_position
if post_position is not None:
	self.post_position = post_position
]:
	i: 
	o: 52()

nname: 0
n 0(None)[if pre_position is not None:
	self.pre_position = pre_position
if post_position is not None:
	self.post_position = post_position
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523e0c>}
nname: 0
n 0(None)[self._reversed_update = reversed_update
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523d6c>}
nname: 42
n 42(None)[]:
	i: 12(), 25()
	o: 

nname: 25
n 25(None)[log.error('Invalid anim_type (linear, log, exp, samples, easein, easeout, easeinout, bounce): %s', anim_type)
]:
	i: 0(f)
	o: 42()

nname: 12
n 12(None)[self._anim_type = anim_type
]:
	i: 0(t)
	o: 42()

nname: 0
n 0(anim_type in ('linear', 'log', 'exp', 'samples', 'easein', 'easeout', 'easeinout', 'bounce'))[]:
	i: 
	o: 12(t), 25(f)

nname: 0
n 0(None)[if anim_type in ('linear', 'log', 'exp', 'samples', 'easein', 'easeout', 'easeinout', 'bounce'):
	self._anim_type = anim_type
else:
	log.error('Invalid anim_type (linear, log, exp, samples, easein, easeout, easeinout, bounce): %s', anim_type)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523eac>}
nname: 0
n 0(None)[self._cyclic = cyclic
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523a0c>}
nname: 93
n 93(None)[return None
]:
	i: 25(JA), 65(JA), 89(), 92()
	o: 

nname: 92
n 92(None)[]:
	i: 0(f)
	o: 93()

nname: 89
n 89(None)[]:
	i: 87(AE)
	o: 93()

nname: 87
n 87(None)[]:
	i: 55(f)
	o: 89(AE)

nname: 65
n 65(None)[#, e
PRINT_EXCEPTION(e, True)
]:
	i: 55(t)
	o: 93(JA)

nname: 55
n 55(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 21(except)
	o: 65(t), 87(f)

nname: 25
n 25(None)[getattr(self, GenericListing.update_handlers[action])(**kw)
]:
	i: 21(try)
	o: 93(JA)

nname: 21
n 21(None)[]:
	i: 0(t)
	o: 25(try), 55(except)

nname: 0
n 0(action is not None)[self.menu_list = value
]:
	i: 
	o: 21(t), 92(f)

nname: 93
n 93(None)[return None
]:
	i: 25(JA), 65(JA), 55(f), 87(AE), 0(f)
	o: 

nname: 65
n 65(None)[#, e
PRINT_EXCEPTION(e, True)
]:
	i: 55(t)
	o: 93(JA)

nname: 55
n 55(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 21(except)
	o: 65(t), 93(f)

nname: 25
n 25(None)[getattr(self, GenericListing.update_handlers[action])(**kw)
]:
	i: 21(try)
	o: 93(JA)

nname: 21
n 21(None)[]:
	i: 0(t)
	o: 25(try), 55(except)

nname: 0
n 0(action is not None)[self.menu_list = value
]:
	i: 
	o: 21(t), 93(f)

nname: 93
n 93(None)[return None
]:
	i: 55(f), 0(f)
	o: 

nname: 55
n 55(None)[except Exception, e:
	PRINT_EXCEPTION(e, True)
]:
	i: 21()
	o: 93(JA)

nname: 21
n 21(None)[try:
	getattr(self, GenericListing.update_handlers[action])(**kw)
]:
	i: 0(t)
	o: 55()

nname: 0
n 0(action is not None)[self.menu_list = value
]:
	i: 
	o: 21(t), 93(f)

nname: 93
n 93(None)[return None
]:
	i: 21(f), 0(f)
	o: 

nname: 21
n 21(None)[try:
	getattr(self, GenericListing.update_handlers[action])(**kw)
except Exception, e:
	PRINT_EXCEPTION(e, True)
]:
	i: 0(t)
	o: 93(JA)

nname: 0
n 0(action is not None)[self.menu_list = value
]:
	i: 
	o: 21(t), 93(f)

nname: 0
n 0(None)[self.menu_list = value
if action is not None:
	try:
		getattr(self, GenericListing.update_handlers[action])(**kw)
	except Exception, e:
		PRINT_EXCEPTION(e, True)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb751424c>}
nname: 81
n 81(None)[]:
	i: 38(), 80()
	o: 

nname: 80
n 80(None)[]:
	i: 0(t)
	o: 81()

nname: 38
n 38(None)[_op = self.style_dict['opacity']
self.set_color(a=_op)
self._initialized = True
]:
	i: 0(f)
	o: 81()

nname: 0
n 0(self._initialized)[self.menu_list = value
self.create_content()
self.do_reset()
]:
	i: 
	o: 38(f), 80(t)

nname: 0
n 0(None)[self.menu_list = value
self.create_content()
self.do_reset()
if not self._initialized:
	_op = self.style_dict['opacity']
	self.set_color(a=_op)
	self._initialized = True
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb751418c>}
nname: 0
n 0(None)[self.menu_list = None
Container.unparent(self)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523b0c>}
nname: 66
n 66(None)[return None
]:
	i: 42(), 59(), 65(AE)
	o: 

nname: 59
n 59(None)[]:
	i: 39(except)
	o: 66()

nname: 42
n 42(None)[self._hidden_item.destroy()
]:
	i: 39(try)
	o: 66()

nname: 39
n 39(None)[]:
	i: 0(AL), 38()
	o: 42(try), 59(except)

nname: 38
n 38(None)[]:
	i: 12(AF), 22()
	o: 39()

nname: 22
n 22(None)[for it in self.item_list:
it.destroy()
]:
	i: 12(for)
	o: 38()

nname: 12
n 12(None)[]:
	i: 0(loop)
	o: 22(for), 38(AF)

nname: 0
n 0(None)[self.menu_list = None
]:
	i: 
	o: 12(loop), 39(AL)

nname: 59
n 59(None)[except:
	pass
return None
]:
	i: 39()
	o: 

nname: 39
n 39(None)[try:
	self._hidden_item.destroy()
]:
	i: 22()
	o: 59()

nname: 22
n 22(None)[for it in self.item_list:
	it.destroy()
]:
	i: 0(for)
	o: 39()

nname: 0
n 0(None)[self.menu_list = None
]:
	i: 
	o: 22(for)

nname: 39
n 39(None)[try:
	self._hidden_item.destroy()
except:
	pass
return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[self.menu_list = None
for it in self.item_list:
	it.destroy()
]:
	i: 
	o: 39()

nname: 0
n 0(None)[self.menu_list = None
for it in self.item_list:
	it.destroy()
try:
	self._hidden_item.destroy()
except:
	pass
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523d0c>}
nname: 117
n 117(None)[]:
	i: 82(), 116()
	o: 

nname: 116
n 116(None)[]:
	i: 79(f)
	o: 117()

nname: 82
n 82(None)[il[position - il.start].marked = ml[position].is_marked()
]:
	i: 79(t)
	o: 117()

nname: 79
n 79(il.start <= position)[]:
	i: 64(), 77()
	o: 82(t), 116(f)

nname: 77
n 77(None)[position
]:
	i: 38(f)
	o: 79()

nname: 64
n 64(None)[]:
	i: 38(t)
	o: 79()

nname: 38
n 38(il.start <= position)[il = self.item_list
]:
	i: 29(), 37()
	o: 64(t), 77(f)

nname: 37
n 37(None)[]:
	i: 0&16(f)
	o: 38()

nname: 29
n 29(None)[]:
	i: 0&16(t)
	o: 38()

nname: 0&16
n 0&16(not ml or position < 0)[ml = self.menu_list
]:
	i: 
	o: 29(t), 37(f)

nname: 117
n 117(None)[]:
	i: 0&16()
	o: 

nname: 0&16
n 0&16(None)[ml = self.menu_list
if not ml or position < 0:
	pass
il = self.item_list
if il.start <= position:
	pass
else:
	position
if il.start <= position:
	il[position - il.start].marked = ml[position].is_marked()
]:
	i: 
	o: 117()

nname: 0&16
n 0&16(None)[ml = self.menu_list
if not ml or position < 0:
	pass
il = self.item_list
if il.start <= position:
	pass
else:
	position
if il.start <= position:
	il[position - il.start].marked = ml[position].is_marked()
]:
	i: 
	o: 

self.nodes: {'0&16': <unpyclib.structure.node instance at 0xb7514a0c>}
nname: 0
n 0(None)[log.error('do update NOT IMPLEMENTED')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523a2c>}
nname: 59
n 59(None)[new_item = self.menu_list[position]
new_index = position - il.start
new_comer = il[new_index]
new_pos = self.positions_list[new_index]
new_comer.widget.animate_stop()
new_comer.reset(new_item, False, position=position + 1)
self.post_position.put(new_comer)
new_comer.fade_in()
new_pos.move(new_comer, self.duration)
]:
	i: 44(), 58()
	o: 

nname: 58
n 58(None)[]:
	i: 41(t)
	o: 59()

nname: 44
n 44(None)[return self._refresh_more_items()
]:
	i: 41(f)
	o: 59()

nname: 41
n 41(il.start <= position)[]:
	i: 26(), 39()
	o: 44(f), 58(t)

nname: 39
n 39(None)[position
]:
	i: 0(f)
	o: 41()

nname: 26
n 26(None)[]:
	i: 0(t)
	o: 41()

nname: 0
n 0(il.start <= position)[il = self.item_list
]:
	i: 
	o: 26(t), 39(f)

nname: 59
n 59(None)[new_item = self.menu_list[position]
new_index = position - il.start
new_comer = il[new_index]
new_pos = self.positions_list[new_index]
new_comer.widget.animate_stop()
new_comer.reset(new_item, False, position=position + 1)
self.post_position.put(new_comer)
new_comer.fade_in()
new_pos.move(new_comer, self.duration)
]:
	i: 0()
	o: 

nname: 0
n 0(None)[il = self.item_list
if il.start <= position:
	pass
else:
	position
if not il.start <= position:
	return self._refresh_more_items()
]:
	i: 
	o: 59()

nname: 0
n 0(None)[il = self.item_list
if il.start <= position:
	pass
else:
	position
if not il.start <= position:
	return self._refresh_more_items()
new_item = self.menu_list[position]
new_index = position - il.start
new_comer = il[new_index]
new_pos = self.positions_list[new_index]
new_comer.widget.animate_stop()
new_comer.reset(new_item, False, position=position + 1)
self.post_position.put(new_comer)
new_comer.fade_in()
new_pos.move(new_comer, self.duration)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7514e2c>}
nname: 0
n 0(None)[log.error('do reset NOT IMPLEMENTED')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523b8c>}
nname: 0
n 0(None)[log.error('do remove NOT IMPLEMENTED')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523b2c>}
nname: 0
n 0(None)[log.error('create_content NOT IMPLEMENTED')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523eac>}
nname: 61
n 61(None)[]:
	i: 24(), 60()
	o: 

nname: 60
n 60(None)[]:
	i: 0(f)
	o: 61()

nname: 24
n 24(None)[self._edited = edit_mode
il[il.selected - il.start].edited = edit_mode
]:
	i: 0(t)
	o: 61()

nname: 0
n 0(self._edited != edit_mode)[il = self.item_list
]:
	i: 
	o: 24(t), 60(f)

nname: 0
n 0(None)[il = self.item_list
if self._edited != edit_mode:
	self._edited = edit_mode
	il[il.selected - il.start].edited = edit_mode
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523e0c>}
nname: 0
n 0(None)[log.error('do swap NOT IMPLEMENTED')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7523c6c>}
nname: 465
n 465(None)[return None
]:
	i: 418(), 464()
	o: 

nname: 464
n 464(None)[]:
	i: 397(f)
	o: 465()

nname: 418
n 418(None)[self._bar.hide()
self._bar.move(vcenter=pl[self._selected]._y)
]:
	i: 397(t)
	o: 465()

nname: 397
n 397(self._bar is not None)[]:
	i: 341(f), 387()
	o: 418(t), 464(f)

nname: 387
n 387(None)[]:
	i: 341(t)
	o: 397()

nname: 341
n 341(self._cyclic)[self.add_child(self._hidden_item.widget)
]:
	i: 244(AL), 340()
	o: 387(t), 397(f)

nname: 340
n 340(None)[]:
	i: 284(AF), 303()
	o: 341()

nname: 303
n 303(None)[self.add_child(ui_item.widget, **pos.get_kwargs())
]:
	i: 284(for)
	o: 340()

nname: 284
n 284(None)[]:
	i: 244(loop)
	o: 303(for), 340(AF)

nname: 244
n 244(None)[del _[2]
]:
	i: 195(AF), 222()
	o: 284(loop), 341(AL)

nname: 222
n 222(None)[for i in pl:
]:
	i: 195(for)
	o: 244()

nname: 195
n 195(None)[]:
	i: 156(), 173()
	o: 222(for), 244(AF)

nname: 173
n 173(None)[]:
	i: 141(f)
	o: 195()

nname: 156
n 156(None)[]:
	i: 141(t)
	o: 195()

nname: 141
n 141(self.post_position is None)[]:
	i: 102(), 119()
	o: 156(t), 173(f)

nname: 119
n 119(None)[]:
	i: 56(f)
	o: 141()

nname: 102
n 102(None)[]:
	i: 56(t)
	o: 141()

nname: 56
n 56(self.pre_position is None)[del _[1]
for pl in self.positions_list:
]:
	i: 0(AF), 34()
	o: 102(t), 119(f)

nname: 34
n 34(None)[for pos in self.positions_list:
]:
	i: 0(for)
	o: 56()

nname: 0
n 0(None)[pos_klass = position_klasses[self.style_dict['pos_policy']]
]:
	i: 
	o: 34(for), 56(AF)

nname: 465
n 465(None)[return None
]:
	i: 341()
	o: 

nname: 341
n 341(None)[self.add_child(self._hidden_item.widget)
if self._cyclic:
	pass
if self._bar is not None:
	self._bar.hide()
	self._bar.move(vcenter=pl[self._selected]._y)
]:
	i: 303()
	o: 465()

nname: 303
n 303(None)[self.add_child(ui_item.widget, **pos.get_kwargs())
	pass]:
	i: 244(for)
	o: 341()

nname: 244
n 244(None)[del _[2]
]:
	i: 195(AF), 222()
	o: 303(for)

nname: 222
n 222(None)[for i in pl:
]:
	i: 195(for)
	o: 244()

nname: 195
n 195(None)[]:
	i: 56()
	o: 222(for), 244(AF)

nname: 56
n 56(None)[del _[1]
for pl in self.positions_list:
if self.pre_position is None:
	pass
if self.post_position is None:
	pass
]:
	i: 0(AF), 34()
	o: 195()

nname: 34
n 34(None)[for pos in self.positions_list:
]:
	i: 0(for)
	o: 56()

nname: 0
n 0(None)[pos_klass = position_klasses[self.style_dict['pos_policy']]
]:
	i: 
	o: 34(for), 56(AF)

nname: 341
n 341(None)[self.add_child(self._hidden_item.widget)
if self._cyclic:
	pass
if self._bar is not None:
	self._bar.hide()
	self._bar.move(vcenter=pl[self._selected]._y)
return None
]:
	i: 244()
	o: 

nname: 244
n 244(None)[del _[2]
self.add_child(ui_item.widget, **pos.get_kwargs())
	pass]:
	i: 56(AF), 222()
	o: 341()

nname: 222
n 222(None)[for i in pl:
]:
	i: 56(for)
	o: 244()

nname: 56
n 56(None)[del _[1]
for pl in self.positions_list:
if self.pre_position is None:
	pass
if self.post_position is None:
	pass
]:
	i: 0(AF), 34()
	o: 222(for), 244(AF)

nname: 34
n 34(None)[for pos in self.positions_list:
]:
	i: 0(for)
	o: 56()

nname: 0
n 0(None)[pos_klass = position_klasses[self.style_dict['pos_policy']]
]:
	i: 
	o: 34(for), 56(AF)

nname: 244
n 244(None)[del _[2]
self.add_child(ui_item.widget, **pos.get_kwargs())
	passself.add_child(self._hidden_item.widget)
if self._cyclic:
	pass
if self._bar is not None:
	self._bar.hide()
	self._bar.move(vcenter=pl[self._selected]._y)
return None
]:
	i: 56(AF), 222()
	o: 

nname: 222
n 222(None)[for i in pl:
]:
	i: 56(for)
	o: 244()

nname: 56
n 56(None)[del _[1]
for pl in self.positions_list:
if self.pre_position is None:
	pass
if self.post_position is None:
	pass
]:
	i: 0(AF), 34()
	o: 222(for), 244(AF)

nname: 34
n 34(None)[for pos in self.positions_list:
]:
	i: 0(for)
	o: 56()

nname: 0
n 0(None)[pos_klass = position_klasses[self.style_dict['pos_policy']]
]:
	i: 
	o: 34(for), 56(AF)

self.nodes: {0: <unpyclib.structure.node instance at 0xb752dcec>, 34: <unpyclib.structure.node instance at 0xb752d02c>, 244: <unpyclib.structure.node instance at 0xb7526f4c>, 56: <unpyclib.structure.node instance at 0xb7526e4c>, 222: <unpyclib.structure.node instance at 0xb752d38c>}
nname: 997
n 997(None)[return None
]:
	i: 989(AE)
	o: 

nname: 989
n 989(None)[del _[1]
]:
	i: 471(finally), 985()
	o: 997(AE)

nname: 985
n 985(None)[]:
	i: 519(AL), 984()
	o: 989()

nname: 984
n 984(None)[]:
	i: 525(AF), 981()
	o: 985()

nname: 981
n 981(None)[]:
	i: 907(AL), 980()
	o: 984()

nname: 980
n 980(None)[]:
	i: 923(AF), 939()
	o: 981()

nname: 939
n 939(None)[for ui_item, pos in zip(il, pl):
ui_item.widget.animate_stop()
pos.move(ui_item, duration)
]:
	i: 923(for)
	o: 980()

nname: 923
n 923(None)[]:
	i: 907(loop)
	o: 939(for), 980(AF)

nname: 907
n 907(None)[new_comer_pos.put(new_comer)
]:
	i: 866(JA), 892(), 896()
	o: 923(loop), 981(AL)

nname: 896
n 896(None)[new_comer.fade_in()
]:
	i: 834(t)
	o: 907()

nname: 892
n 892(None)[]:
	i: 843(f)
	o: 907()

nname: 866
n 866(None)[new_comer.widget.get_obj_by_name('marker').show()
]:
	i: 843(t)
	o: 907(JA)

nname: 843
n 843(new_comer._marked)[new_comer.active_widget.show()
]:
	i: 834(f)
	o: 866(t), 892(f)

nname: 834
n 834(self._activate_fade)[]:
	i: 714(), 773(), 823()
	o: 843(f), 896(t)

nname: 823
n 823(None)[new_comer.destroy()
]:
	i: 760(f)
	o: 834()

nname: 773
n 773(None)[new_item = ml[new_item_idx % len_ml]
new_comer.reset(new_item, new_item is selected, position=new_item_idx + index_offset)
]:
	i: 760(t)
	o: 834()

nname: 760
n 760(cyclic is True)[]:
	i: 711(f)
	o: 773(t), 823(f)

nname: 714
n 714(None)[new_item = ml[new_item_idx]
new_comer.reset(new_item, new_item is selected, position=new_item_idx + index_offset)
]:
	i: 711(t)
	o: 834()

nname: 711
n 711(0 <= new_item_idx)[]:
	i: 699(), 709()
	o: 714(t), 760(f)

nname: 709
n 709(None)[new_item_idx
]:
	i: 638(f)
	o: 711()

nname: 699
n 699(None)[]:
	i: 638(t)
	o: 711()

nname: 638
n 638(0 <= new_item_idx)[new_comer = self._hidden_item
self._hidden_item = outsider
new_comer.widget.animate_stop()
il.insert(new_comer_idx, new_comer)
]:
	i: 588(), 627()
	o: 699(t), 709(f)

nname: 627
n 627(None)[outsider.fade_out()
]:
	i: 532(t)
	o: 638()

nname: 588
n 588(None)[outsider.active_widget.hide()
outsider.widget.get_obj_by_name('marker').hide()
]:
	i: 532(f)
	o: 638()

nname: 532
n 532(self._activate_fade)[for new_item_idx in new_comers_indices:
outsider = il.pop(outsider_idx)
outsider.widget.animate_stop()
outsider_pos.move(outsider, duration)
]:
	i: 525(for)
	o: 588(f), 627(t)

nname: 525
n 525(None)[]:
	i: 519(loop)
	o: 532(for), 984(AF)

nname: 519
n 519(None)[cyclic = cyclic
]:
	i: 491(f), 509()
	o: 525(loop), 985(AL)

nname: 509
n 509(None)[]:
	i: 491(t)
	o: 519()

nname: 491
n 491(cyclic)[_[1], len_ml = render_lock.__exit__, len(ml)
]:
	i: 471(ASF)
	o: 509(t), 519(f)

nname: 471
n 471(None)[render_lock.__enter__()
]:
	i: 366(JA), 392(JA), 401(), 404()
	o: 491(ASF), 989(finally)

nname: 404
n 404(None)[outsider_pos = self.post_position
new_comer_pos = self.pre_position
outsider_idx = -1
new_comers_indices = <genexpr>(xrange(1, -move + 1))
new_comer_idx = 0
]:
	i: 286(f)
	o: 471()

nname: 401
n 401(None)[]:
	i: 399(AE)
	o: 471()

nname: 399
n 399(None)[]:
	i: 382(f)
	o: 401(AE)

nname: 392
n 392(None)[]:
	i: 382(t)
	o: 471(JA)

nname: 382
n 382(<dummy_ex3> EXC_MATCH IndexError)[]:
	i: 298(except)
	o: 392(t), 399(f)

nname: 366
n 366(None)[ml[old_end + move]
]:
	i: 298(try)
	o: 471(JA)

nname: 298
n 298(None)[outsider_pos = self.pre_position
new_comer_pos = self.post_position
outsider_idx = 0
new_comers_indices = <genexpr>(xrange(move))
new_comer_idx = len(il)
]:
	i: 286(t)
	o: 366(try), 382(except)

nname: 286
n 286(move > 0)[]:
	i: 276(), 285()
	o: 298(t), 404(f)

nname: 285
n 285(None)[]:
	i: 21(f)
	o: 286()

nname: 276
n 276(None)[cyclic = False
]:
	i: 138(), 196()
	o: 286()

nname: 196
n 196(None)[ml = ml[max(0, new_start):new_end] + [None] * abs(new_start)
hole_size = old_start - new_end
move += hole_size
old_start -= hole_size
old_end -= hole_size
]:
	i: 105(f)
	o: 276()

nname: 138
n 138(None)[ml = [None] * old_end + ml[new_start:new_end]
hole_size = new_start - old_end
move -= hole_size
index_offset += hole_size
]:
	i: 105(t)
	o: 276()

nname: 105
n 105(move > 0)[new_start = old_start + move
new_end = old_end + move
]:
	i: 21(t)
	o: 138(t), 196(f)

nname: 21
n 21(abs(move) > len(il))[il = self.item_list
ml = self.menu_list
pl = self.positions_list
old_start = il.start
old_end = il.end
index_offset = 1
cyclic = self._cyclic
]:
	i: 12(), 20()
	o: 105(t), 285(f)

nname: 20
n 20(None)[]:
	i: 0(f)
	o: 21()

nname: 12
n 12(None)[return None
]:
	i: 0(t)
	o: 21()

nname: 0
n 0(move == 0)[]:
	i: 
	o: 12(t), 20(f)

nname: 997
n 997(None)[return None
]:
	i: 989(AE)
	o: 

nname: 989
n 989(None)[del _[1]
]:
	i: 471(finally), 491(AL), 525(AF), 939()
	o: 997(AE)

nname: 939
n 939(None)[for ui_item, pos in zip(il, pl):
	ui_item.widget.animate_stop()
	pos.move(ui_item, duration)
]:
	i: 907(for)
	o: 989()

nname: 907
n 907(None)[new_comer_pos.put(new_comer)
]:
	i: 711(JA)
	o: 939(for)

nname: 711
n 711(None)[if 0 <= new_item_idx:
	new_item = ml[new_item_idx]
	new_comer.reset(new_item, new_item is selected, position=new_item_idx + index_offset)
else:
	if cyclic is True:
		new_item = ml[new_item_idx % len_ml]
		new_comer.reset(new_item, new_item is selected, position=new_item_idx + index_offset)
	else:
		new_comer.destroy()
if not self._activate_fade:
	new_comer.active_widget.show()
	if new_comer._marked:
		new_comer.widget.get_obj_by_name('marker').show()
else:
	new_comer.fade_in()
]:
	i: 532()
	o: 907(JA)

nname: 532
n 532(None)[for new_item_idx in new_comers_indices:
outsider = il.pop(outsider_idx)
outsider.widget.animate_stop()
outsider_pos.move(outsider, duration)
if not self._activate_fade:
	outsider.active_widget.hide()
	outsider.widget.get_obj_by_name('marker').hide()
else:
	outsider.fade_out()
new_comer = self._hidden_item
self._hidden_item = outsider
new_comer.widget.animate_stop()
il.insert(new_comer_idx, new_comer)
if 0 <= new_item_idx:
	pass
else:
	new_item_idx
]:
	i: 525(for)
	o: 711()

nname: 525
n 525(None)[]:
	i: 491(loop)
	o: 532(for), 989(AF)

nname: 491
n 491(None)[_[1], len_ml = render_lock.__exit__, len(ml)
if cyclic:
	pass
cyclic = cyclic
]:
	i: 471(ASF)
	o: 525(loop), 989(AL)

nname: 471
n 471(None)[render_lock.__enter__()
]:
	i: 366(JA), 404(), 382(f), 382(t), 399(AE)
	o: 491(ASF), 989(finally)

nname: 404
n 404(None)[outsider_pos = self.post_position
new_comer_pos = self.pre_position
outsider_idx = -1
new_comers_indices = <genexpr>(xrange(1, -move + 1))
new_comer_idx = 0
]:
	i: 286(f)
	o: 471()

nname: 382
n 382(<dummy_ex3> EXC_MATCH IndexError)[]:
	i: 298(except)
	o: 471(f)

nname: 366
n 366(None)[ml[old_end + move]
]:
	i: 298(try)
	o: 471(JA)

nname: 298
n 298(None)[outsider_pos = self.pre_position
new_comer_pos = self.post_position
outsider_idx = 0
new_comers_indices = <genexpr>(xrange(move))
new_comer_idx = len(il)
]:
	i: 286(t)
	o: 366(try), 382(except)

structureSingleExcept Exception 'NoneType' object has no attribute 'toNode'
nname: 286
n 286(move > 0)[]:
	i: 105(), 0(f)
	o: 298(t), 404(f)

nname: 105
n 105(None)[new_start = old_start + move
new_end = old_end + move
if move > 0:
	ml = [None] * old_end + ml[new_start:new_end]
	hole_size = new_start - old_end
	move -= hole_size
	index_offset += hole_size
else:
	ml = ml[max(0, new_start):new_end] + [None] * abs(new_start)
	hole_size = old_start - new_end
	move += hole_size
	old_start -= hole_size
	old_end -= hole_size
cyclic = False
]:
	i: 0(t)
	o: 286()

nname: 0
n 0(abs(move) > len(il))[if move == 0:
	return None
il = self.item_list
ml = self.menu_list
pl = self.positions_list
old_start = il.start
old_end = il.end
index_offset = 1
cyclic = self._cyclic
]:
	i: 
	o: 105(t), 286(f)

nname: 997
n 997(None)[return None
]:
	i: 989(AE)
	o: 

nname: 989
n 989(None)[del _[1]
]:
	i: 471(finally), 491(AL), 525(AF), 907()
	o: 997(AE)

nname: 907
n 907(None)[new_comer_pos.put(new_comer)
for ui_item, pos in zip(il, pl):
	ui_item.widget.animate_stop()
	pos.move(ui_item, duration)
]:
	i: 532(JA)
	o: 989()

nname: 532
n 532(None)[for new_item_idx in new_comers_indices:
outsider = il.pop(outsider_idx)
outsider.widget.animate_stop()
outsider_pos.move(outsider, duration)
if not self._activate_fade:
	outsider.active_widget.hide()
	outsider.widget.get_obj_by_name('marker').hide()
else:
	outsider.fade_out()
new_comer = self._hidden_item
self._hidden_item = outsider
new_comer.widget.animate_stop()
il.insert(new_comer_idx, new_comer)
if 0 <= new_item_idx:
	pass
else:
	new_item_idx
if 0 <= new_item_idx:
	new_item = ml[new_item_idx]
	new_comer.reset(new_item, new_item is selected, position=new_item_idx + index_offset)
else:
	if cyclic is True:
		new_item = ml[new_item_idx % len_ml]
		new_comer.reset(new_item, new_item is selected, position=new_item_idx + index_offset)
	else:
		new_comer.destroy()
if not self._activate_fade:
	new_comer.active_widget.show()
	if new_comer._marked:
		new_comer.widget.get_obj_by_name('marker').show()
else:
	new_comer.fade_in()
]:
	i: 525(for)
	o: 907(JA)

nname: 525
n 525(None)[]:
	i: 491(loop)
	o: 532(for), 989(AF)

nname: 491
n 491(None)[_[1], len_ml = render_lock.__exit__, len(ml)
if cyclic:
	pass
cyclic = cyclic
]:
	i: 471(ASF)
	o: 525(loop), 989(AL)

nname: 471
n 471(None)[render_lock.__enter__()
]:
	i: 366(JA), 404(), 382(t), 399(AE), 298(except)
	o: 491(ASF), 989(finally)

nname: 404
n 404(None)[outsider_pos = self.post_position
new_comer_pos = self.pre_position
outsider_idx = -1
new_comers_indices = <genexpr>(xrange(1, -move + 1))
new_comer_idx = 0
]:
	i: 0(f)
	o: 471()

nname: 366
n 366(None)[ml[old_end + move]
]:
	i: 298(try)
	o: 471(JA)

nname: 298
n 298(None)[outsider_pos = self.pre_position
new_comer_pos = self.post_position
outsider_idx = 0
new_comers_indices = <genexpr>(xrange(move))
new_comer_idx = len(il)
]:
	i: 0(t)
	o: 366(try), 471(except)

nname: 0
n 0(move > 0)[if move == 0:
	return None
il = self.item_list
ml = self.menu_list
pl = self.positions_list
old_start = il.start
old_end = il.end
index_offset = 1
cyclic = self._cyclic
if abs(move) > len(il):
	new_start = old_start + move
	new_end = old_end + move
	if move > 0:
		ml = [None] * old_end + ml[new_start:new_end]
		hole_size = new_start - old_end
		move -= hole_size
		index_offset += hole_size
	else:
		ml = ml[max(0, new_start):new_end] + [None] * abs(new_start)
		hole_size = old_start - new_end
		move += hole_size
		old_start -= hole_size
		old_end -= hole_size
	cyclic = False
]:
	i: 
	o: 298(t), 404(f)

nname: 997
n 997(None)[return None
]:
	i: 989(AE)
	o: 

nname: 989
n 989(None)[del _[1]
]:
	i: 471(finally), 491(AL), 525(AF), 532()
	o: 997(AE)

nname: 532
n 532(None)[for new_item_idx in new_comers_indices:
outsider = il.pop(outsider_idx)
outsider.widget.animate_stop()
outsider_pos.move(outsider, duration)
if not self._activate_fade:
	outsider.active_widget.hide()
	outsider.widget.get_obj_by_name('marker').hide()
else:
	outsider.fade_out()
new_comer = self._hidden_item
self._hidden_item = outsider
new_comer.widget.animate_stop()
il.insert(new_comer_idx, new_comer)
if 0 <= new_item_idx:
	pass
else:
	new_item_idx
if 0 <= new_item_idx:
	new_item = ml[new_item_idx]
	new_comer.reset(new_item, new_item is selected, position=new_item_idx + index_offset)
else:
	if cyclic is True:
		new_item = ml[new_item_idx % len_ml]
		new_comer.reset(new_item, new_item is selected, position=new_item_idx + index_offset)
	else:
		new_comer.destroy()
if not self._activate_fade:
	new_comer.active_widget.show()
	if new_comer._marked:
		new_comer.widget.get_obj_by_name('marker').show()
else:
	new_comer.fade_in()
new_comer_pos.put(new_comer)
for ui_item, pos in zip(il, pl):
	ui_item.widget.animate_stop()
	pos.move(ui_item, duration)
]:
	i: 525(for)
	o: 989()

nname: 525
n 525(None)[]:
	i: 491(loop)
	o: 532(for), 989(AF)

nname: 491
n 491(None)[_[1], len_ml = render_lock.__exit__, len(ml)
if cyclic:
	pass
cyclic = cyclic
]:
	i: 471(ASF)
	o: 525(loop), 989(AL)

nname: 471
n 471(None)[except:
	render_lock.__enter__()
]:
	i: 366(JA), 404(), 382(t), 399(AE), 298(except)
	o: 491(ASF), 989(finally)

nname: 404
n 404(None)[outsider_pos = self.post_position
new_comer_pos = self.pre_position
outsider_idx = -1
new_comers_indices = <genexpr>(xrange(1, -move + 1))
new_comer_idx = 0
]:
	i: 0(f)
	o: 471()

nname: 366
n 366(None)[ml[old_end + move]
]:
	i: 298(try)
	o: 471(JA)

nname: 298
n 298(None)[outsider_pos = self.pre_position
new_comer_pos = self.post_position
outsider_idx = 0
new_comers_indices = <genexpr>(xrange(move))
new_comer_idx = len(il)
]:
	i: 0(t)
	o: 366(try), 471(except)

nname: 0
n 0(move > 0)[if move == 0:
	return None
il = self.item_list
ml = self.menu_list
pl = self.positions_list
old_start = il.start
old_end = il.end
index_offset = 1
cyclic = self._cyclic
if abs(move) > len(il):
	new_start = old_start + move
	new_end = old_end + move
	if move > 0:
		ml = [None] * old_end + ml[new_start:new_end]
		hole_size = new_start - old_end
		move -= hole_size
		index_offset += hole_size
	else:
		ml = ml[max(0, new_start):new_end] + [None] * abs(new_start)
		hole_size = old_start - new_end
		move += hole_size
		old_start -= hole_size
		old_end -= hole_size
	cyclic = False
]:
	i: 
	o: 298(t), 404(f)

self.nodes: {0: <unpyclib.structure.node instance at 0xb752d3ac>, 525: <unpyclib.structure.node instance at 0xb753558c>, 399: <unpyclib.structure.node instance at 0xb75359ec>, 404: <unpyclib.structure.node instance at 0xb75351ec>, 532: <unpyclib.structure.node instance at 0xb75262ac>, 298: <unpyclib.structure.node instance at 0xb7535dec>, 471: <unpyclib.structure.node instance at 0xb75351ac>, 989: <unpyclib.structure.node instance at 0x9b144ec>, 997: <unpyclib.structure.node instance at 0x9b1456c>, 491: <unpyclib.structure.node instance at 0xb752d6ac>, 366: <unpyclib.structure.node instance at 0xb7535d4c>}
nname: 323
n 323(None)[return True
]:
	i: 315(AE)
	o: 

nname: 315
n 315(None)[del _[1]
]:
	i: 167(finally), 311()
	o: 323(AE)

nname: 311
n 311(None)[]:
	i: 187(AL), 310()
	o: 315()

nname: 310
n 310(None)[]:
	i: 199(AF), 246()
	o: 311()

nname: 246
n 246(None)[for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
ui_item.widget.animate_stop()
pos.move(ui_item, self.duration)
ui_item.set_position(menu_item_idx + 1)
]:
	i: 199(for)
	o: 310()

nname: 199
n 199(None)[]:
	i: 187(loop)
	o: 246(for), 310(AF)

nname: 187
n 187(None)[_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
]:
	i: 167(ASF)
	o: 199(loop), 311(AL)

nname: 167
n 167(None)[render_lock.__enter__()
]:
	i: 158(), 166()
	o: 187(ASF), 315(finally)

nname: 166
n 166(None)[]:
	i: 145&151(t)
	o: 167()

nname: 158
n 158(None)[return True
]:
	i: 145&151(f)
	o: 167()

nname: 145&151
n 145&151(in_page1 and in_page2)[]:
	i: 136(), 144()
	o: 158(f), 166(t)

nname: 144
n 144(None)[]:
	i: 123(f)
	o: 145&151()

nname: 136
n 136(None)[return False
]:
	i: 123(t)
	o: 145&151()

nname: 123
n 123(in_page1 ^ in_page2)[in_page2 = 0 <= item_index2
]:
	i: 111(), 121()
	o: 136(t), 144(f)

nname: 121
n 121(None)[item_index2
]:
	i: 94(f)
	o: 123()

nname: 111
n 111(None)[]:
	i: 94(t)
	o: 123()

nname: 94
n 94(0 <= item_index2)[in_page1 = 0 <= item_index1
]:
	i: 82(), 92()
	o: 111(t), 121(f)

nname: 92
n 92(None)[item_index1
]:
	i: 0(f)
	o: 94()

nname: 82
n 82(None)[]:
	i: 0(t)
	o: 94()

nname: 0
n 0(0 <= item_index1)[il = self.item_list
ml = self.menu_list
pl = self.positions_list
nb_positions = len(pl)
start = il.start
item_index1 = i1 - start
item_index2 = i2 - start
]:
	i: 
	o: 82(t), 92(f)

nname: 323
n 323(None)[return True
]:
	i: 315(AE)
	o: 

nname: 315
n 315(None)[del _[1]
]:
	i: 167(finally), 246()
	o: 323(AE)

nname: 246
n 246(None)[for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
	ui_item.widget.animate_stop()
	pos.move(ui_item, self.duration)
	ui_item.set_position(menu_item_idx + 1)
]:
	i: 187(for)
	o: 315()

nname: 187
n 187(None)[_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
]:
	i: 167(ASF)
	o: 246(for)

nname: 167
n 167(None)[render_lock.__enter__()
]:
	i: 123()
	o: 187(ASF), 315(finally)

nname: 123
n 123(None)[in_page2 = 0 <= item_index2
if in_page1 ^ in_page2:
	return False
if not(in_page1 and in_page2):
	return True
]:
	i: 0()
	o: 167()

nname: 0
n 0(None)[il = self.item_list
ml = self.menu_list
pl = self.positions_list
nb_positions = len(pl)
start = il.start
item_index1 = i1 - start
item_index2 = i2 - start
if 0 <= item_index1:
	pass
else:
	item_index1
in_page1 = 0 <= item_index1
if 0 <= item_index2:
	pass
else:
	item_index2
]:
	i: 
	o: 123()

nname: 323
n 323(None)[return True
]:
	i: 315(AE)
	o: 

nname: 315
n 315(None)[del _[1]
]:
	i: 167(finally), 187()
	o: 323(AE)

nname: 187
n 187(None)[_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
	ui_item.widget.animate_stop()
	pos.move(ui_item, self.duration)
	ui_item.set_position(menu_item_idx + 1)
]:
	i: 167(ASF)
	o: 315()

nname: 167
n 167(None)[render_lock.__enter__()
]:
	i: 0()
	o: 187(ASF), 315(finally)

nname: 0
n 0(None)[il = self.item_list
ml = self.menu_list
pl = self.positions_list
nb_positions = len(pl)
start = il.start
item_index1 = i1 - start
item_index2 = i2 - start
if 0 <= item_index1:
	pass
else:
	item_index1
in_page1 = 0 <= item_index1
if 0 <= item_index2:
	pass
else:
	item_index2
in_page2 = 0 <= item_index2
if in_page1 ^ in_page2:
	return False
if not(in_page1 and in_page2):
	return True
]:
	i: 
	o: 167()

nname: 323
n 323(None)[return True
]:
	i: 187()
	o: 

nname: 187
n 187(None)[try:
	_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
	for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
		ui_item.widget.animate_stop()
		pos.move(ui_item, self.duration)
		ui_item.set_position(menu_item_idx + 1)
finally:
	del _[1]
]:
	i: 0(ASF)
	o: 323()

nname: 0
n 0(None)[il = self.item_list
ml = self.menu_list
pl = self.positions_list
nb_positions = len(pl)
start = il.start
item_index1 = i1 - start
item_index2 = i2 - start
if 0 <= item_index1:
	pass
else:
	item_index1
in_page1 = 0 <= item_index1
if 0 <= item_index2:
	pass
else:
	item_index2
in_page2 = 0 <= item_index2
if in_page1 ^ in_page2:
	return False
if not(in_page1 and in_page2):
	return True
render_lock.__enter__()
]:
	i: 
	o: 187(ASF)

nname: 323
n 323(None)[return True
]:
	i: 0()
	o: 

nname: 0
n 0(None)[il = self.item_list
ml = self.menu_list
pl = self.positions_list
nb_positions = len(pl)
start = il.start
item_index1 = i1 - start
item_index2 = i2 - start
if 0 <= item_index1:
	pass
else:
	item_index1
in_page1 = 0 <= item_index1
if 0 <= item_index2:
	pass
else:
	item_index2
in_page2 = 0 <= item_index2
if in_page1 ^ in_page2:
	return False
if not(in_page1 and in_page2):
	return True
render_lock.__enter__()
try:
	_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
	for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
		ui_item.widget.animate_stop()
		pos.move(ui_item, self.duration)
		ui_item.set_position(menu_item_idx + 1)
finally:
	del _[1]
]:
	i: 
	o: 323()

nname: 0
n 0(None)[il = self.item_list
ml = self.menu_list
pl = self.positions_list
nb_positions = len(pl)
start = il.start
item_index1 = i1 - start
item_index2 = i2 - start
if 0 <= item_index1:
	pass
else:
	item_index1
in_page1 = 0 <= item_index1
if 0 <= item_index2:
	pass
else:
	item_index2
in_page2 = 0 <= item_index2
if in_page1 ^ in_page2:
	return False
if not(in_page1 and in_page2):
	return True
render_lock.__enter__()
try:
	_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
	for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
		ui_item.widget.animate_stop()
		pos.move(ui_item, self.duration)
		ui_item.set_position(menu_item_idx + 1)
finally:
	del _[1]
return True
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7526bac>}
nname: 628
n 628(None)[return None
]:
	i: 532(AL), 627()
	o: 

nname: 627
n 627(None)[]:
	i: 547(AF), 572()
	o: 628()

nname: 572
n 572(None)[for i, ui_item in enumerate(zip(il, self.positions_list)):
pos.move(ui_item, duration)
ui_item.set_position(start + i + idx_offset)
]:
	i: 547(for)
	o: 627()

nname: 547
n 547(None)[]:
	i: 532(loop)
	o: 572(for), 627(AF)

nname: 532
n 532(None)[idx_offset = 0
duration = self.duration
]:
	i: 521(), 528()
	o: 547(loop), 628(AL)

nname: 528
n 528(None)[]:
	i: 505(f)
	o: 532()

nname: 521
n 521(None)[]:
	i: 505(t)
	o: 532()

nname: 505
n 505(scroll_up)[newcomer.fade_in()
]:
	i: 468(), 494()
	o: 521(t), 528(f)

nname: 494
n 494(None)[newcomer.destroy()
]:
	i: 443(f)
	o: 505()

nname: 468
n 468(None)[newcomer.reset(new_item, new_item is selected)
]:
	i: 443(t)
	o: 505()

nname: 443
n 443(new_item is not None)[newcomer_position.put(newcomer)
]:
	i: 368(), 431()
	o: 468(t), 494(f)

nname: 431
n 431(None)[new_item = None
newcomer_position = self.pre_position
]:
	i: 412(), 427()
	o: 443()

nname: 427
n 427(None)[]:
	i: 383(f)
	o: 431()

nname: 412
n 412(None)[]:
	i: 383(t)
	o: 431()

nname: 383
n 383(start > 0)[il.insert(0, newcomer)
]:
	i: 270(f)
	o: 412(t), 427(f)

nname: 368
n 368(None)[new_item = None
newcomer_position = self.post_position
]:
	i: 349(), 364()
	o: 443()

nname: 364
n 364(None)[]:
	i: 317(f)
	o: 368()

nname: 349
n 349(None)[]:
	i: 317(t)
	o: 368()

nname: 317
n 317(len(ml) >= end)[il.append(newcomer)
]:
	i: 270(t)
	o: 349(t), 364(f)

nname: 270
n 270(scroll_up)[outsider.fade_out()
newcomer = self._hidden_item
self._hidden_item = outsider
newcomer.widget.animate_stop()
]:
	i: 74(), 251()
	o: 317(t), 383(f)

nname: 251
n 251(None)[outsider_position.move(ui_item, self.duration)
]:
	i: 135(), 230()
	o: 270()

nname: 230
n 230(None)[outsider = il.pop()
outsider_position = self.post_position
]:
	i: 222(), 229()
	o: 251()

nname: 229
n 229(None)[]:
	i: 162(f)
	o: 230()

nname: 222
n 222(None)[return None
]:
	i: 175(AL), 221()
	o: 230()

nname: 221
n 221(None)[]:
	i: 179(AF), 192()
	o: 222()

nname: 192
n 192(None)[for i, ui_item in enumerate(il):
ui_item.set_position(start + i)
]:
	i: 179(for)
	o: 221()

nname: 179
n 179(None)[]:
	i: 175(loop)
	o: 192(for), 221(AF)

nname: 175
n 175(None)[]:
	i: 162(t)
	o: 179(loop), 222(AL)

nname: 162
n 162(position < start)[]:
	i: 106(f)
	o: 175(t), 229(f)

nname: 135
n 135(None)[outsider = il.pop(0)
outsider_position = self.pre_position
]:
	i: 126(), 134()
	o: 251()

nname: 134
n 134(None)[]:
	i: 113(f)
	o: 135()

nname: 126
n 126(None)[return None
]:
	i: 113(t)
	o: 135()

nname: 113
n 113(position >= end)[]:
	i: 106(t)
	o: 126(t), 134(f)

nname: 106
n 106(scroll_up)[]:
	i: 71(f)
	o: 113(t), 162(f)

nname: 74
n 74(None)[outsider = il.pop(position - start)
outsider.selected = False
]:
	i: 71(t)
	o: 270()

nname: 71
n 71(start <= position)[]:
	i: 59(), 69()
	o: 74(t), 106(f)

nname: 69
n 69(None)[position
]:
	i: 0(f)
	o: 71()

nname: 59
n 59(None)[]:
	i: 0(t)
	o: 71()

nname: 0
n 0(start <= position)[il = self.item_list
ml = self.menu_list
selected = ml.selected
start = il.start
end = il.end
]:
	i: 
	o: 59(t), 69(f)

nname: 628
n 628(None)[return None
]:
	i: 572()
	o: 

nname: 572
n 572(None)[for i, ui_item in enumerate(zip(il, self.positions_list)):
	pos.move(ui_item, duration)
	ui_item.set_position(start + i + idx_offset)
]:
	i: 532(for)
	o: 628()

nname: 532
n 532(None)[idx_offset = 0
duration = self.duration
]:
	i: 443()
	o: 572(for)

nname: 443
n 443(None)[newcomer_position.put(newcomer)
if new_item is not None:
	newcomer.reset(new_item, new_item is selected)
else:
	newcomer.destroy()
newcomer.fade_in()
if scroll_up:
	pass
]:
	i: 317(), 383()
	o: 532()

nname: 383
n 383(None)[il.insert(0, newcomer)
if start > 0:
	pass
new_item = None
newcomer_position = self.pre_position
]:
	i: 270(f)
	o: 443()

nname: 317
n 317(None)[il.append(newcomer)
if len(ml) >= end:
	pass
new_item = None
newcomer_position = self.post_position
]:
	i: 270(t)
	o: 443()

nname: 270
n 270(scroll_up)[outsider.fade_out()
newcomer = self._hidden_item
self._hidden_item = outsider
newcomer.widget.animate_stop()
]:
	i: 74(), 251()
	o: 317(t), 383(f)

nname: 251
n 251(None)[outsider_position.move(ui_item, self.duration)
]:
	i: 113(), 230()
	o: 270()

nname: 230
n 230(None)[outsider = il.pop()
outsider_position = self.post_position
]:
	i: 222(), 162(f)
	o: 251()

nname: 222
n 222(None)[return None
]:
	i: 192()
	o: 230()

nname: 192
n 192(None)[for i, ui_item in enumerate(il):
	ui_item.set_position(start + i)
]:
	i: 175(for)
	o: 222()

nname: 175
n 175(None)[]:
	i: 162(t)
	o: 192(for)

nname: 162
n 162(position < start)[]:
	i: 106(f)
	o: 175(t), 230(f)

nname: 113
n 113(None)[if position >= end:
	return None
outsider = il.pop(0)
outsider_position = self.pre_position
]:
	i: 106(t)
	o: 251()

nname: 106
n 106(scroll_up)[]:
	i: 0(f)
	o: 113(t), 162(f)

nname: 74
n 74(None)[outsider = il.pop(position - start)
outsider.selected = False
]:
	i: 0(t)
	o: 270()

nname: 0
n 0(start <= position)[il = self.item_list
ml = self.menu_list
selected = ml.selected
start = il.start
end = il.end
if start <= position:
	pass
else:
	position
]:
	i: 
	o: 74(t), 106(f)

nname: 628
n 628(None)[return None
]:
	i: 532()
	o: 

nname: 532
n 532(None)[idx_offset = 0
duration = self.duration
for i, ui_item in enumerate(zip(il, self.positions_list)):
	pos.move(ui_item, duration)
	ui_item.set_position(start + i + idx_offset)
]:
	i: 270()
	o: 628()

nname: 270
n 270(None)[outsider.fade_out()
newcomer = self._hidden_item
self._hidden_item = outsider
newcomer.widget.animate_stop()
if scroll_up:
	il.append(newcomer)
	if len(ml) >= end:
		pass
	new_item = None
	newcomer_position = self.post_position
else:
	il.insert(0, newcomer)
	if start > 0:
		pass
	new_item = None
	newcomer_position = self.pre_position
newcomer_position.put(newcomer)
if new_item is not None:
	newcomer.reset(new_item, new_item is selected)
else:
	newcomer.destroy()
newcomer.fade_in()
if scroll_up:
	pass
]:
	i: 74(), 251()
	o: 532()

nname: 251
n 251(None)[outsider_position.move(ui_item, self.duration)
]:
	i: 113(), 230()
	o: 270()

nname: 230
n 230(None)[outsider = il.pop()
outsider_position = self.post_position
]:
	i: 222(), 162(f)
	o: 251()

nname: 222
n 222(None)[return None
]:
	i: 175()
	o: 230()

nname: 175
n 175(None)[for i, ui_item in enumerate(il):
	ui_item.set_position(start + i)
]:
	i: 162(t)
	o: 222()

nname: 162
n 162(position < start)[]:
	i: 106(f)
	o: 175(t), 230(f)

nname: 113
n 113(None)[if position >= end:
	return None
outsider = il.pop(0)
outsider_position = self.pre_position
]:
	i: 106(t)
	o: 251()

nname: 106
n 106(scroll_up)[]:
	i: 0(f)
	o: 113(t), 162(f)

nname: 74
n 74(None)[outsider = il.pop(position - start)
outsider.selected = False
]:
	i: 0(t)
	o: 270()

nname: 0
n 0(start <= position)[il = self.item_list
ml = self.menu_list
selected = ml.selected
start = il.start
end = il.end
if start <= position:
	pass
else:
	position
]:
	i: 
	o: 74(t), 106(f)

nname: 628
n 628(None)[return None
]:
	i: 270()
	o: 

nname: 270
n 270(None)[outsider.fade_out()
newcomer = self._hidden_item
self._hidden_item = outsider
newcomer.widget.animate_stop()
if scroll_up:
	il.append(newcomer)
	if len(ml) >= end:
		pass
	new_item = None
	newcomer_position = self.post_position
else:
	il.insert(0, newcomer)
	if start > 0:
		pass
	new_item = None
	newcomer_position = self.pre_position
newcomer_position.put(newcomer)
if new_item is not None:
	newcomer.reset(new_item, new_item is selected)
else:
	newcomer.destroy()
newcomer.fade_in()
if scroll_up:
	pass
idx_offset = 0
duration = self.duration
for i, ui_item in enumerate(zip(il, self.positions_list)):
	pos.move(ui_item, duration)
	ui_item.set_position(start + i + idx_offset)
]:
	i: 74(), 251()
	o: 628()

nname: 251
n 251(None)[outsider_position.move(ui_item, self.duration)
]:
	i: 113(), 230()
	o: 270()

nname: 230
n 230(None)[outsider = il.pop()
outsider_position = self.post_position
]:
	i: 175(), 162(f)
	o: 251()

nname: 175
n 175(None)[for i, ui_item in enumerate(il):
	ui_item.set_position(start + i)
return None
]:
	i: 162(t)
	o: 230()

nname: 162
n 162(position < start)[]:
	i: 106(f)
	o: 175(t), 230(f)

nname: 113
n 113(None)[if position >= end:
	return None
outsider = il.pop(0)
outsider_position = self.pre_position
]:
	i: 106(t)
	o: 251()

nname: 106
n 106(scroll_up)[]:
	i: 0(f)
	o: 113(t), 162(f)

nname: 74
n 74(None)[outsider = il.pop(position - start)
outsider.selected = False
]:
	i: 0(t)
	o: 270()

nname: 0
n 0(start <= position)[il = self.item_list
ml = self.menu_list
selected = ml.selected
start = il.start
end = il.end
if start <= position:
	pass
else:
	position
]:
	i: 
	o: 74(t), 106(f)

nname: 270
n 270(None)[outsider.fade_out()
newcomer = self._hidden_item
self._hidden_item = outsider
newcomer.widget.animate_stop()
if scroll_up:
	il.append(newcomer)
	if len(ml) >= end:
		pass
	new_item = None
	newcomer_position = self.post_position
else:
	il.insert(0, newcomer)
	if start > 0:
		pass
	new_item = None
	newcomer_position = self.pre_position
newcomer_position.put(newcomer)
if new_item is not None:
	newcomer.reset(new_item, new_item is selected)
else:
	newcomer.destroy()
newcomer.fade_in()
if scroll_up:
	pass
idx_offset = 0
duration = self.duration
for i, ui_item in enumerate(zip(il, self.positions_list)):
	pos.move(ui_item, duration)
	ui_item.set_position(start + i + idx_offset)
return None
]:
	i: 74(), 251()
	o: 

nname: 251
n 251(None)[outsider_position.move(ui_item, self.duration)
]:
	i: 113(), 162()
	o: 270()

nname: 162
n 162(None)[if position < start:
	for i, ui_item in enumerate(il):
		ui_item.set_position(start + i)
	return None
outsider = il.pop()
outsider_position = self.post_position
]:
	i: 106(f)
	o: 251()

nname: 113
n 113(None)[if position >= end:
	return None
outsider = il.pop(0)
outsider_position = self.pre_position
]:
	i: 106(t)
	o: 251()

nname: 106
n 106(scroll_up)[]:
	i: 0(f)
	o: 113(t), 162(f)

nname: 74
n 74(None)[outsider = il.pop(position - start)
outsider.selected = False
]:
	i: 0(t)
	o: 270()

nname: 0
n 0(start <= position)[il = self.item_list
ml = self.menu_list
selected = ml.selected
start = il.start
end = il.end
if start <= position:
	pass
else:
	position
]:
	i: 
	o: 74(t), 106(f)

nname: 270
n 270(None)[outsider.fade_out()
newcomer = self._hidden_item
self._hidden_item = outsider
newcomer.widget.animate_stop()
if scroll_up:
	il.append(newcomer)
	if len(ml) >= end:
		pass
	new_item = None
	newcomer_position = self.post_position
else:
	il.insert(0, newcomer)
	if start > 0:
		pass
	new_item = None
	newcomer_position = self.pre_position
newcomer_position.put(newcomer)
if new_item is not None:
	newcomer.reset(new_item, new_item is selected)
else:
	newcomer.destroy()
newcomer.fade_in()
if scroll_up:
	pass
idx_offset = 0
duration = self.duration
for i, ui_item in enumerate(zip(il, self.positions_list)):
	pos.move(ui_item, duration)
	ui_item.set_position(start + i + idx_offset)
return None
]:
	i: 74(), 106()
	o: 

nname: 106
n 106(None)[if scroll_up:
	if position >= end:
		return None
	outsider = il.pop(0)
	outsider_position = self.pre_position
else:
	if position < start:
		for i, ui_item in enumerate(il):
			ui_item.set_position(start + i)
		return None
	outsider = il.pop()
	outsider_position = self.post_position
outsider_position.move(ui_item, self.duration)
]:
	i: 0(f)
	o: 270()

nname: 74
n 74(None)[outsider = il.pop(position - start)
outsider.selected = False
]:
	i: 0(t)
	o: 270()

nname: 0
n 0(start <= position)[il = self.item_list
ml = self.menu_list
selected = ml.selected
start = il.start
end = il.end
if start <= position:
	pass
else:
	position
]:
	i: 
	o: 74(t), 106(f)

nname: 0
n 0(None)[il = self.item_list
ml = self.menu_list
selected = ml.selected
start = il.start
end = il.end
if start <= position:
	pass
else:
	position
if start <= position:
	outsider = il.pop(position - start)
	outsider.selected = False
else:
	if scroll_up:
		if position >= end:
			return None
		outsider = il.pop(0)
		outsider_position = self.pre_position
	else:
		if position < start:
			for i, ui_item in enumerate(il):
				ui_item.set_position(start + i)
			return None
		outsider = il.pop()
		outsider_position = self.post_position
	outsider_position.move(ui_item, self.duration)
outsider.fade_out()
newcomer = self._hidden_item
self._hidden_item = outsider
newcomer.widget.animate_stop()
if scroll_up:
	il.append(newcomer)
	if len(ml) >= end:
		pass
	new_item = None
	newcomer_position = self.post_position
else:
	il.insert(0, newcomer)
	if start > 0:
		pass
	new_item = None
	newcomer_position = self.pre_position
newcomer_position.put(newcomer)
if new_item is not None:
	newcomer.reset(new_item, new_item is selected)
else:
	newcomer.destroy()
newcomer.fade_in()
if scroll_up:
	pass
idx_offset = 0
duration = self.duration
for i, ui_item in enumerate(zip(il, self.positions_list)):
	pos.move(ui_item, duration)
	ui_item.set_position(start + i + idx_offset)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7526a6c>}
nname: 254
n 254(None)[self._more_items_after = mia
]:
	i: 185(JA), 209(), 229(), 253()
	o: 

nname: 253
n 253(None)[]:
	i: 213(f)
	o: 254()

nname: 229
n 229(None)[send('%s_no_more_items_after' % self.name, menu)
]:
	i: 213(t)
	o: 254()

nname: 213
n 213(self._more_items_after is not False)[]:
	i: 133(f)
	o: 229(t), 253(f)

nname: 209
n 209(None)[]:
	i: 169(f)
	o: 254()

nname: 185
n 185(None)[send('%s_more_items_after' % self.name, menu)
]:
	i: 169(t)
	o: 254(JA)

nname: 169
n 169(self._more_items_after is not True)[]:
	i: 133(t)
	o: 185(t), 209(f)

nname: 133
n 133(mia)[self._more_items_before = mib
mia = len(ml) > il.end
]:
	i: 64(JA), 88(), 108(), 132()
	o: 169(t), 213(f)

nname: 132
n 132(None)[]:
	i: 92(f)
	o: 133()

nname: 108
n 108(None)[send('%s_no_more_items_before' % self.name, menu)
]:
	i: 92(t)
	o: 133()

nname: 92
n 92(self._more_items_before is not False)[]:
	i: 0(f)
	o: 108(t), 132(f)

nname: 88
n 88(None)[]:
	i: 48(f)
	o: 133()

nname: 64
n 64(None)[send('%s_more_items_before' % self.name, menu)
]:
	i: 48(t)
	o: 133(JA)

nname: 48
n 48(self._more_items_before is not True)[]:
	i: 0(t)
	o: 64(t), 88(f)

nname: 0
n 0(mib)[il = self.item_list
ml = self.menu_list
menu = ml.menu
mib = il.start > 0
]:
	i: 
	o: 48(t), 92(f)

nname: 254
n 254(None)[self._more_items_after = mia
]:
	i: 0(JA)
	o: 

nname: 0
n 0(None)[il = self.item_list
ml = self.menu_list
menu = ml.menu
mib = il.start > 0
if mib:
	if self._more_items_before is not True:
		send('%s_more_items_before' % self.name, menu)
else:
	if self._more_items_before is not False:
		send('%s_no_more_items_before' % self.name, menu)
self._more_items_before = mib
mia = len(ml) > il.end
if mia:
	if self._more_items_after is not True:
		send('%s_more_items_after' % self.name, menu)
else:
	if self._more_items_after is not False:
		send('%s_no_more_items_after' % self.name, menu)
]:
	i: 
	o: 254(JA)

nname: 0
n 0(None)[il = self.item_list
ml = self.menu_list
menu = ml.menu
mib = il.start > 0
if mib:
	if self._more_items_before is not True:
		send('%s_more_items_before' % self.name, menu)
else:
	if self._more_items_before is not False:
		send('%s_no_more_items_before' % self.name, menu)
self._more_items_before = mib
mia = len(ml) > il.end
if mia:
	if self._more_items_after is not True:
		send('%s_more_items_after' % self.name, menu)
else:
	if self._more_items_after is not False:
		send('%s_no_more_items_after' % self.name, menu)
self._more_items_after = mia
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb752656c>}
nname: 56
n 56(None)[return min(pos + self.item_list.start, len(self.menu_list) - 1)
]:
	i: 41(), 55()
	o: 

nname: 55
n 55(None)[]:
	i: 0(f)
	o: 56()

nname: 41
n 41(None)[pos = nb_positions - 1
]:
	i: 0(t)
	o: 56()

nname: 0
n 0(pos >= nb_positions)[nb_positions = len(self.positions_list)
pos = ratio // 100 // nb_positions
]:
	i: 
	o: 41(t), 55(f)

nname: 0
n 0(None)[nb_positions = len(self.positions_list)
pos = ratio // 100 // nb_positions
if pos >= nb_positions:
	pos = nb_positions - 1
return min(pos + self.item_list.start, len(self.menu_list) - 1)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7526d0c>}
nname: 114
n 114(None)[]:
	i: 15(), 87()
	o: 

nname: 87
n 87(None)[return max(0, il.selected - len(il))
]:
	i: 0(f)
	o: 114()

nname: 15
n 15(None)[ml = self.menu_list
pos = il.selected
new_pos = pos + len(il)
ml[pos:new_pos]
return min(new_pos, len(ml) - 1)
]:
	i: 0(t)
	o: 114()

nname: 0
n 0(forward)[il = self.item_list
]:
	i: 
	o: 15(t), 87(f)

nname: 0
n 0(None)[il = self.item_list
if forward:
	ml = self.menu_list
	pos = il.selected
	new_pos = pos + len(il)
	ml[pos:new_pos]
	return min(new_pos, len(ml) - 1)
else:
	return max(0, il.selected - len(il))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb752674c>}
nname: 124
n 124(None)[return None
]:
	i: 89(JA), 106(), 123()
	o: 

nname: 123
n 123(None)[]:
	i: 0(f)
	o: 124()

nname: 106
n 106(None)[self._bar.hide()
]:
	i: 66&73(f)
	o: 124()

nname: 89
n 89(None)[self._bar.show()
]:
	i: 66&73(t)
	o: 124(JA)

nname: 66&73
n 66&73(select and len(self.menu_list))[]:
	i: 0(t)
	o: 89(t), 106(f)

nname: 0
n 0(self._bar is not None)[il = self.item_list
il[max(0, il.selected - il.start)].selected = select
self._no_selection = not select
]:
	i: 
	o: 66&73(t), 123(f)

nname: 0
n 0(None)[il = self.item_list
il[max(0, il.selected - il.start)].selected = select
self._no_selection = not select
if self._bar is not None:
	if select and len(self.menu_list):
		self._bar.show()
	else:
		self._bar.hide()
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75262ac>}
nname: 6
n 6(None)[__doc__ = '\n    Listing widget.\n    '
_initialized = False
_bar = None
item_list = None
positions_list = [('20%', '20%'), ('50%', '50%'), ('80%', '80%')]
pre_position = None
post_position = None
_centered = False
_selected = 0
duration = 0.0
_edited = False
_more_items_before = None
_more_items_after = None
_no_selection = False
_reversed_update = False
_anim_type = 'linear'
_activate_fade = True
_cyclic = True
update_handlers = dict(update='do_update', reset='do_reset', add='do_add', mark='do_mark', remove='do_remove', edit='do_edit', swap='do_swap', enable_selection='do_enable_selection')
def __init__(self):
	Container.__init__(self)
	self.style_dict = dict(font_style='font=Vera font_size=18', text_color=(255, 255, 255, 255), text_size=('100%', '100%'), selected_font_style='font=Vera font_size=20', selected_text_color=(255, 255, 255, 255), selected_text_size=('100%', '100%'), unsensitive_font_style='font=Vera font_size=18', unsensitive_text_color=(255, 255, 255, 255), unsensitive_text_size=('100%', '100%'), repository='', icon_size=('100%', '100%'), selected_icon_size=('100%', '100%'), unsensitive_icon_size=('100%', '100%'), item_size=('100%', '100%'), selected_item_size=('100%', '100%'), progress_bar_background='', progress_bar_foreground='', progress_bar_offset=('0%', '0%'), progress_bar_size=('5%', '100%'), rec_icon='', rec_icon_offset=('75%', '0%'), time_offset=('5%', '0%'), time_font_style='font=Gill font_size=20 align=left', time_color=(128, 0, 64, 255), title_font_style='font=Gill font_size=20 align=left wrap=char', title_color=(128, 128, 128, 255), selected_time_font_style='font=Gill font_size=24 align=left', selected_time_color=(255, 0, 128, 255), selected_title_font_style='font=Gill font_size=24 align=left wrap=char', selected_title_color=(255, 255, 255, 255), selected_blurb_time_font_style='font=Gill font_size=24 align=left', selected_blurb_time_color=(255, 0, 128, 255), selected_blurb_title_font_style='font=Gill font_size=24 align=left wrap=char', selected_blurb_title_color=(255, 255, 255, 255), selected_blurb_text_offset=('0%', '14%'), selected_blurb_offset=('-2%', '1%'), selected_blurb_zoom='110%', selection_cursor_image='', preserve_icon_aspect=0, preserve_icon_size=0, marker_image=None, selected_marker_image=None, marker_offset=('0%', '0%'), marker_size=('100%', '10%'), centered=False, text_offset=('0%', '4%'), selected_text_offset=('0%', '14%'), enumerated=False, edit_offset=20, duration=1, opacity=255, maxlen=20, extension=('png',), autoscroll=True, page_jump='reset', pos_policy='position', fade_pre_post=True)
	return None

def update_style(self, **kwargs):
	self.style_dict.update(kwargs)

def set_positions(self, positions=None):
	self.positions_list = positions

def set_selected_item(self, selected_item=0):
	self._selected = selected_item

def set_centered(self, centered=False):
	self._centered = centered
	self.style_dict['centered'] = centered

def set_duration(self, duration=0.0):
	self.duration = duration
	self.style_dict['duration'] = duration

def set_bar(self, bar):
	self._bar = self.get_obj_by_name(bar)

def set_repository(self, repository=None):
	self.repository = repository
	self.style_dict['repository'] = repository

def set_extra_positions(self, pre_position=None, post_position=None):
	if pre_position is not None:
		self.pre_position = pre_position
	if post_position is not None:
		self.post_position = post_position
	return None

def set_reversed_update(self, reversed_update=True):
	self._reversed_update = reversed_update

def set_anim_type(self, anim_type='linear'):
	if anim_type in ('linear', 'log', 'exp', 'samples', 'easein', 'easeout', 'easeinout', 'bounce'):
		self._anim_type = anim_type
	else:
		log.error('Invalid anim_type (linear, log, exp, samples, easein, easeout, easeinout, bounce): %s', anim_type)

def set_cyclic(self, cyclic=False):
	self._cyclic = cyclic

def update(self, signal, sender, value, action=None, **kw):
	self.menu_list = value
	if action is not None:
		try:
			getattr(self, GenericListing.update_handlers[action])(**kw)
		except Exception, e:
			PRINT_EXCEPTION(e, True)
	return None

def initialize(self, signal, sender, value, **kw):
	self.menu_list = value
	self.create_content()
	self.do_reset()
	if not self._initialized:
		_op = self.style_dict['opacity']
		self.set_color(a=_op)
		self._initialized = True

def unparent(self):
	self.menu_list = None
	Container.unparent(self)
	return None

def clear(self):
	self.menu_list = None
	for it in self.item_list:
		it.destroy()
	try:
		self._hidden_item.destroy()
	except:
		pass
	return None

def do_mark(self, position=None):
	ml = self.menu_list
	if not ml or position < 0:
		pass
	il = self.item_list
	if il.start <= position:
		pass
	else:
		position
	if il.start <= position:
		il[position - il.start].marked = ml[position].is_marked()

def do_update(self, position):
	log.error('do update NOT IMPLEMENTED')

def do_add(self, position):
	il = self.item_list
	if il.start <= position:
		pass
	else:
		position
	if not il.start <= position:
		return self._refresh_more_items()
	new_item = self.menu_list[position]
	new_index = position - il.start
	new_comer = il[new_index]
	new_pos = self.positions_list[new_index]
	new_comer.widget.animate_stop()
	new_comer.reset(new_item, False, position=position + 1)
	self.post_position.put(new_comer)
	new_comer.fade_in()
	new_pos.move(new_comer, self.duration)

def do_reset(self, position=None, focus=None):
	log.error('do reset NOT IMPLEMENTED')

def do_remove(self, position):
	log.error('do remove NOT IMPLEMENTED')

def create_content(self):
	log.error('create_content NOT IMPLEMENTED')

def do_edit(self, edit_mode):
	il = self.item_list
	if self._edited != edit_mode:
		self._edited = edit_mode
		il[il.selected - il.start].edited = edit_mode

def do_swap(self, i1, i2):
	log.error('do swap NOT IMPLEMENTED')

def _create_content(self, start, style_name):
	pos_klass = position_klasses[self.style_dict['pos_policy']]

def _scroll(self, move, duration, selected):
	if move == 0:
		return None
	il = self.item_list
	ml = self.menu_list
	pl = self.positions_list
	old_start = il.start
	old_end = il.end
	index_offset = 1
	cyclic = self._cyclic
	if abs(move) > len(il):
		new_start = old_start + move
		new_end = old_end + move
		if move > 0:
			ml = [None] * old_end + ml[new_start:new_end]
			hole_size = new_start - old_end
			move -= hole_size
			index_offset += hole_size
		else:
			ml = ml[max(0, new_start):new_end] + [None] * abs(new_start)
			hole_size = old_start - new_end
			move += hole_size
			old_start -= hole_size
			old_end -= hole_size
		cyclic = False

def _swap_items(self, i1, i2):
	il = self.item_list
	ml = self.menu_list
	pl = self.positions_list
	nb_positions = len(pl)
	start = il.start
	item_index1 = i1 - start
	item_index2 = i2 - start
	if 0 <= item_index1:
		pass
	else:
		item_index1
	in_page1 = 0 <= item_index1
	if 0 <= item_index2:
		pass
	else:
		item_index2
	in_page2 = 0 <= item_index2
	if in_page1 ^ in_page2:
		return False
	if not(in_page1 and in_page2):
		return True
	render_lock.__enter__()
	try:
		_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
		for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
			ui_item.widget.animate_stop()
			pos.move(ui_item, self.duration)
			ui_item.set_position(menu_item_idx + 1)
	finally:
		del _[1]
	return True

def _remove_item(self, position, scroll_up):
	il = self.item_list
	ml = self.menu_list
	selected = ml.selected
	start = il.start
	end = il.end
	if start <= position:
		pass
	else:
		position
	if start <= position:
		outsider = il.pop(position - start)
		outsider.selected = False
	else:
		if scroll_up:
			if position >= end:
				return None
			outsider = il.pop(0)
			outsider_position = self.pre_position
		else:
			if position < start:
				for i, ui_item in enumerate(il):
					ui_item.set_position(start + i)
				return None
			outsider = il.pop()
			outsider_position = self.post_position
		outsider_position.move(ui_item, self.duration)
	outsider.fade_out()
	newcomer = self._hidden_item
	self._hidden_item = outsider
	newcomer.widget.animate_stop()
	if scroll_up:
		il.append(newcomer)
		if len(ml) >= end:
			pass
		new_item = None
		newcomer_position = self.post_position
	else:
		il.insert(0, newcomer)
		if start > 0:
			pass
		new_item = None
		newcomer_position = self.pre_position
	newcomer_position.put(newcomer)
	if new_item is not None:
		newcomer.reset(new_item, new_item is selected)
	else:
		newcomer.destroy()
	newcomer.fade_in()
	if scroll_up:
		pass
	idx_offset = 0
	duration = self.duration
	for i, ui_item in enumerate(zip(il, self.positions_list)):
		pos.move(ui_item, duration)
		ui_item.set_position(start + i + idx_offset)
	return None

def _refresh_more_items(self):
	il = self.item_list
	ml = self.menu_list
	menu = ml.menu
	mib = il.start > 0
	if mib:
		if self._more_items_before is not True:
			send('%s_more_items_before' % self.name, menu)
	else:
		if self._more_items_before is not False:
			send('%s_no_more_items_before' % self.name, menu)
	self._more_items_before = mib
	mia = len(ml) > il.end
	if mia:
		if self._more_items_after is not True:
			send('%s_more_items_after' % self.name, menu)
	else:
		if self._more_items_after is not False:
			send('%s_no_more_items_after' % self.name, menu)
	self._more_items_after = mia

def pick(self, ratio):
	nb_positions = len(self.positions_list)
	pos = ratio // 100 // nb_positions
	if pos >= nb_positions:
		pos = nb_positions - 1
	return min(pos + self.item_list.start, len(self.menu_list) - 1)

def page_jump(self, forward):
	il = self.item_list
	if forward:
		ml = self.menu_list
		pos = il.selected
		new_pos = pos + len(il)
		ml[pos:new_pos]
		return min(new_pos, len(ml) - 1)
	else:
		return max(0, il.selected - len(il))

def do_enable_selection(self, select):
	il = self.item_list
	il[max(0, il.selected - il.start)].selected = select
	self._no_selection = not select
	if self._bar is not None:
		if select and len(self.menu_list):
			self._bar.show()
		else:
			self._bar.hide()
	return None

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb751320c>}
nname: 38
n 38(None)[xkey, ykey = ('left', 'top')
self._move_dic = {xkey: x, ykey: y}
self._anim_type = listing._anim_type
]:
	i: 27(), 34()
	o: 

nname: 34
n 34(None)[]:
	i: 0(f)
	o: 38()

nname: 27
n 27(None)[]:
	i: 0(t)
	o: 38()

nname: 0
n 0(listing._centered)[self._x = x
self._y = y
]:
	i: 
	o: 27(t), 34(f)

nname: 0
n 0(None)[self._x = x
self._y = y
if listing._centered:
	pass
xkey, ykey = ('left', 'top')
self._move_dic = {xkey: x, ykey: y}
self._anim_type = listing._anim_type
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75135cc>}
nname: 0
n 0(None)[return self._move_dic
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb751308c>}
nname: 0
n 0(None)[ui_item.widget.move(**self._move_dic)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb751328c>}
nname: 0
n 0(None)[ui_item.widget.animate('move', duration=duration, step_type=self._anim_type, **self._move_dic)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75133ac>}
nname: 6
n 6(None)[__slots__ = ('_x', '_y', '_move_dic', '_anim_type')
def __init__(self, listing, x, y):
	self._x = x
	self._y = y
	if listing._centered:
		pass
	xkey, ykey = ('left', 'top')
	self._move_dic = {xkey: x, ykey: y}
	self._anim_type = listing._anim_type

def get_kwargs(self):
	return self._move_dic

def put(self, ui_item):
	ui_item.widget.move(**self._move_dic)

def move(self, ui_item, duration):
	ui_item.widget.animate('move', duration=duration, step_type=self._anim_type, **self._move_dic)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb750eeec>}
nname: 65
n 65(None)[self._layer = layer
]:
	i: 37(), 64()
	o: 

nname: 64
n 64(None)[]:
	i: 0(t)
	o: 65()

nname: 37
n 37(None)[print 'Invalid position (x, y, layer):',
print x,
print y,
print layer
layer = 0
]:
	i: 0(f)
	o: 65()

nname: 0
n 0(isinstance(layer, int))[Position.__init__(self, listing, x, y)
]:
	i: 
	o: 37(f), 64(t)

nname: 0
n 0(None)[Position.__init__(self, listing, x, y)
if not isinstance(layer, int):
	print 'Invalid position (x, y, layer):',
	print x,
	print y,
	print layer
	layer = 0
self._layer = layer
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb751372c>}
nname: 0
n 0(None)[kwargs = dict(self._move_dic)
kwargs['layer'] = self._layer
return kwargs
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb751340c>}
nname: 0
n 0(None)[Position.put(self, ui_item)
ui_item.widget.set_layer(self._layer)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75130cc>}
nname: 0
n 0(None)[Position.move(self, ui_item, duration)
ui_item.widget.set_layer(self._layer)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75133ec>}
nname: 6
n 6(None)[__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_layer')
def __init__(self, listing, x, y, layer):
	Position.__init__(self, listing, x, y)
	if not isinstance(layer, int):
		print 'Invalid position (x, y, layer):',
		print x,
		print y,
		print layer
		layer = 0
	self._layer = layer

def get_kwargs(self):
	kwargs = dict(self._move_dic)
	kwargs['layer'] = self._layer
	return kwargs

def put(self, ui_item):
	Position.put(self, ui_item)
	ui_item.widget.set_layer(self._layer)

def move(self, ui_item, duration):
	Position.move(self, ui_item, duration)
	ui_item.widget.set_layer(self._layer)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb750ef6c>}
nname: 0
n 0(None)[Position.__init__(self, listing, x, y)
self._width = width
self._height = height
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75132cc>}
nname: 0
n 0(None)[Position.put(self, ui_item)
ui_item.active_widget.resize(width=self._width, height=self._height)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7513bac>}
nname: 0
n 0(None)[Position.move(self, ui_item, duration)
ui_item.active_widget.animate('size', width=self._width, height=self._height, step_type=self._anim_type, duration=duration)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb751368c>}
nname: 6
n 6(None)[__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_width', '_height')
def __init__(self, listing, x, y, width, height):
	Position.__init__(self, listing, x, y)
	self._width = width
	self._height = height

def put(self, ui_item):
	Position.put(self, ui_item)
	ui_item.active_widget.resize(width=self._width, height=self._height)

def move(self, ui_item, duration):
	Position.move(self, ui_item, duration)
	ui_item.active_widget.animate('size', width=self._width, height=self._height, step_type=self._anim_type, duration=duration)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb750edcc>}
nname: 73
n 73(None)[self._layer = layer
self._width = width
self._height = height
]:
	i: 37(), 72()
	o: 

nname: 72
n 72(None)[]:
	i: 0(t)
	o: 73()

nname: 37
n 37(None)[print 'Invalid position: (x, y, width, height, layer)',
print x,
print y,
print width,
print height,
print layer
layer = 0
]:
	i: 0(f)
	o: 73()

nname: 0
n 0(isinstance(layer, int))[Position.__init__(self, listing, x, y)
]:
	i: 
	o: 37(f), 72(t)

nname: 0
n 0(None)[Position.__init__(self, listing, x, y)
if not isinstance(layer, int):
	print 'Invalid position: (x, y, width, height, layer)',
	print x,
	print y,
	print width,
	print height,
	print layer
	layer = 0
self._layer = layer
self._width = width
self._height = height
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75136cc>}
nname: 0
n 0(None)[kwargs = dict(self._move_dic)
kwargs['layer'] = self._layer
return kwargs
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75133cc>}
nname: 0
n 0(None)[Position.put(self, ui_item)
ui_item.active_widget.resize(width=self._width, height=self._height)
ui_item.widget.set_layer(self._layer)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7513c4c>}
nname: 0
n 0(None)[Position.move(self, ui_item, duration)
ui_item.active_widget.animate('size', width=self._width, height=self._height, step_type=self._anim_type, duration=duration)
ui_item.widget.set_layer(self._layer)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb751366c>}
nname: 6
n 6(None)[__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_layer', '_width', '_height')
def __init__(self, listing, x, y, width, height, layer):
	Position.__init__(self, listing, x, y)
	if not isinstance(layer, int):
		print 'Invalid position: (x, y, width, height, layer)',
		print x,
		print y,
		print width,
		print height,
		print layer
		layer = 0
	self._layer = layer
	self._width = width
	self._height = height

def get_kwargs(self):
	kwargs = dict(self._move_dic)
	kwargs['layer'] = self._layer
	return kwargs

def put(self, ui_item):
	Position.put(self, ui_item)
	ui_item.active_widget.resize(width=self._width, height=self._height)
	ui_item.widget.set_layer(self._layer)

def move(self, ui_item, duration):
	Position.move(self, ui_item, duration)
	ui_item.active_widget.animate('size', width=self._width, height=self._height, step_type=self._anim_type, duration=duration)
	ui_item.widget.set_layer(self._layer)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb750ee6c>}
nname: 0
n 0(None)[from __future__ import absolute_import, with_statement
__all__ = ['GenericListing']
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send
from .items import class_item_name_dict, ItemList
from wyvas import Container, render_lock
log = GET_LOGGER(__name__)
class GenericListing(Container):
	__doc__ = '\n    Listing widget.\n    '
	_initialized = False
	_bar = None
	item_list = None
	positions_list = [('20%', '20%'), ('50%', '50%'), ('80%', '80%')]
	pre_position = None
	post_position = None
	_centered = False
	_selected = 0
	duration = 0.0
	_edited = False
	_more_items_before = None
	_more_items_after = None
	_no_selection = False
	_reversed_update = False
	_anim_type = 'linear'
	_activate_fade = True
	_cyclic = True
	update_handlers = dict(update='do_update', reset='do_reset', add='do_add', mark='do_mark', remove='do_remove', edit='do_edit', swap='do_swap', enable_selection='do_enable_selection')
	def __init__(self):
		Container.__init__(self)
		self.style_dict = dict(font_style='font=Vera font_size=18', text_color=(255, 255, 255, 255), text_size=('100%', '100%'), selected_font_style='font=Vera font_size=20', selected_text_color=(255, 255, 255, 255), selected_text_size=('100%', '100%'), unsensitive_font_style='font=Vera font_size=18', unsensitive_text_color=(255, 255, 255, 255), unsensitive_text_size=('100%', '100%'), repository='', icon_size=('100%', '100%'), selected_icon_size=('100%', '100%'), unsensitive_icon_size=('100%', '100%'), item_size=('100%', '100%'), selected_item_size=('100%', '100%'), progress_bar_background='', progress_bar_foreground='', progress_bar_offset=('0%', '0%'), progress_bar_size=('5%', '100%'), rec_icon='', rec_icon_offset=('75%', '0%'), time_offset=('5%', '0%'), time_font_style='font=Gill font_size=20 align=left', time_color=(128, 0, 64, 255), title_font_style='font=Gill font_size=20 align=left wrap=char', title_color=(128, 128, 128, 255), selected_time_font_style='font=Gill font_size=24 align=left', selected_time_color=(255, 0, 128, 255), selected_title_font_style='font=Gill font_size=24 align=left wrap=char', selected_title_color=(255, 255, 255, 255), selected_blurb_time_font_style='font=Gill font_size=24 align=left', selected_blurb_time_color=(255, 0, 128, 255), selected_blurb_title_font_style='font=Gill font_size=24 align=left wrap=char', selected_blurb_title_color=(255, 255, 255, 255), selected_blurb_text_offset=('0%', '14%'), selected_blurb_offset=('-2%', '1%'), selected_blurb_zoom='110%', selection_cursor_image='', preserve_icon_aspect=0, preserve_icon_size=0, marker_image=None, selected_marker_image=None, marker_offset=('0%', '0%'), marker_size=('100%', '10%'), centered=False, text_offset=('0%', '4%'), selected_text_offset=('0%', '14%'), enumerated=False, edit_offset=20, duration=1, opacity=255, maxlen=20, extension=('png',), autoscroll=True, page_jump='reset', pos_policy='position', fade_pre_post=True)
		return None

	def update_style(self, **kwargs):
		self.style_dict.update(kwargs)

	def set_positions(self, positions=None):
		self.positions_list = positions

	def set_selected_item(self, selected_item=0):
		self._selected = selected_item

	def set_centered(self, centered=False):
		self._centered = centered
		self.style_dict['centered'] = centered

	def set_duration(self, duration=0.0):
		self.duration = duration
		self.style_dict['duration'] = duration

	def set_bar(self, bar):
		self._bar = self.get_obj_by_name(bar)

	def set_repository(self, repository=None):
		self.repository = repository
		self.style_dict['repository'] = repository

	def set_extra_positions(self, pre_position=None, post_position=None):
		if pre_position is not None:
			self.pre_position = pre_position
		if post_position is not None:
			self.post_position = post_position
		return None

	def set_reversed_update(self, reversed_update=True):
		self._reversed_update = reversed_update

	def set_anim_type(self, anim_type='linear'):
		if anim_type in ('linear', 'log', 'exp', 'samples', 'easein', 'easeout', 'easeinout', 'bounce'):
			self._anim_type = anim_type
		else:
			log.error('Invalid anim_type (linear, log, exp, samples, easein, easeout, easeinout, bounce): %s', anim_type)

	def set_cyclic(self, cyclic=False):
		self._cyclic = cyclic

	def update(self, signal, sender, value, action=None, **kw):
		self.menu_list = value
		if action is not None:
			try:
				getattr(self, GenericListing.update_handlers[action])(**kw)
			except Exception, e:
				PRINT_EXCEPTION(e, True)
		return None

	def initialize(self, signal, sender, value, **kw):
		self.menu_list = value
		self.create_content()
		self.do_reset()
		if not self._initialized:
			_op = self.style_dict['opacity']
			self.set_color(a=_op)
			self._initialized = True

	def unparent(self):
		self.menu_list = None
		Container.unparent(self)
		return None

	def clear(self):
		self.menu_list = None
		for it in self.item_list:
			it.destroy()
		try:
			self._hidden_item.destroy()
		except:
			pass
		return None

	def do_mark(self, position=None):
		ml = self.menu_list
		if not ml or position < 0:
			pass
		il = self.item_list
		if il.start <= position:
			pass
		else:
			position
		if il.start <= position:
			il[position - il.start].marked = ml[position].is_marked()

	def do_update(self, position):
		log.error('do update NOT IMPLEMENTED')

	def do_add(self, position):
		il = self.item_list
		if il.start <= position:
			pass
		else:
			position
		if not il.start <= position:
			return self._refresh_more_items()
		new_item = self.menu_list[position]
		new_index = position - il.start
		new_comer = il[new_index]
		new_pos = self.positions_list[new_index]
		new_comer.widget.animate_stop()
		new_comer.reset(new_item, False, position=position + 1)
		self.post_position.put(new_comer)
		new_comer.fade_in()
		new_pos.move(new_comer, self.duration)

	def do_reset(self, position=None, focus=None):
		log.error('do reset NOT IMPLEMENTED')

	def do_remove(self, position):
		log.error('do remove NOT IMPLEMENTED')

	def create_content(self):
		log.error('create_content NOT IMPLEMENTED')

	def do_edit(self, edit_mode):
		il = self.item_list
		if self._edited != edit_mode:
			self._edited = edit_mode
			il[il.selected - il.start].edited = edit_mode

	def do_swap(self, i1, i2):
		log.error('do swap NOT IMPLEMENTED')

	def _create_content(self, start, style_name):
		pos_klass = position_klasses[self.style_dict['pos_policy']]

	def _scroll(self, move, duration, selected):
		if move == 0:
			return None
		il = self.item_list
		ml = self.menu_list
		pl = self.positions_list
		old_start = il.start
		old_end = il.end
		index_offset = 1
		cyclic = self._cyclic
		if abs(move) > len(il):
			new_start = old_start + move
			new_end = old_end + move
			if move > 0:
				ml = [None] * old_end + ml[new_start:new_end]
				hole_size = new_start - old_end
				move -= hole_size
				index_offset += hole_size
			else:
				ml = ml[max(0, new_start):new_end] + [None] * abs(new_start)
				hole_size = old_start - new_end
				move += hole_size
				old_start -= hole_size
				old_end -= hole_size
			cyclic = False

	def _swap_items(self, i1, i2):
		il = self.item_list
		ml = self.menu_list
		pl = self.positions_list
		nb_positions = len(pl)
		start = il.start
		item_index1 = i1 - start
		item_index2 = i2 - start
		if 0 <= item_index1:
			pass
		else:
			item_index1
		in_page1 = 0 <= item_index1
		if 0 <= item_index2:
			pass
		else:
			item_index2
		in_page2 = 0 <= item_index2
		if in_page1 ^ in_page2:
			return False
		if not(in_page1 and in_page2):
			return True
		render_lock.__enter__()
		try:
			_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
			for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
				ui_item.widget.animate_stop()
				pos.move(ui_item, self.duration)
				ui_item.set_position(menu_item_idx + 1)
		finally:
			del _[1]
		return True

	def _remove_item(self, position, scroll_up):
		il = self.item_list
		ml = self.menu_list
		selected = ml.selected
		start = il.start
		end = il.end
		if start <= position:
			pass
		else:
			position
		if start <= position:
			outsider = il.pop(position - start)
			outsider.selected = False
		else:
			if scroll_up:
				if position >= end:
					return None
				outsider = il.pop(0)
				outsider_position = self.pre_position
			else:
				if position < start:
					for i, ui_item in enumerate(il):
						ui_item.set_position(start + i)
					return None
				outsider = il.pop()
				outsider_position = self.post_position
			outsider_position.move(ui_item, self.duration)
		outsider.fade_out()
		newcomer = self._hidden_item
		self._hidden_item = outsider
		newcomer.widget.animate_stop()
		if scroll_up:
			il.append(newcomer)
			if len(ml) >= end:
				pass
			new_item = None
			newcomer_position = self.post_position
		else:
			il.insert(0, newcomer)
			if start > 0:
				pass
			new_item = None
			newcomer_position = self.pre_position
		newcomer_position.put(newcomer)
		if new_item is not None:
			newcomer.reset(new_item, new_item is selected)
		else:
			newcomer.destroy()
		newcomer.fade_in()
		if scroll_up:
			pass
		idx_offset = 0
		duration = self.duration
		for i, ui_item in enumerate(zip(il, self.positions_list)):
			pos.move(ui_item, duration)
			ui_item.set_position(start + i + idx_offset)
		return None

	def _refresh_more_items(self):
		il = self.item_list
		ml = self.menu_list
		menu = ml.menu
		mib = il.start > 0
		if mib:
			if self._more_items_before is not True:
				send('%s_more_items_before' % self.name, menu)
		else:
			if self._more_items_before is not False:
				send('%s_no_more_items_before' % self.name, menu)
		self._more_items_before = mib
		mia = len(ml) > il.end
		if mia:
			if self._more_items_after is not True:
				send('%s_more_items_after' % self.name, menu)
		else:
			if self._more_items_after is not False:
				send('%s_no_more_items_after' % self.name, menu)
		self._more_items_after = mia

	def pick(self, ratio):
		nb_positions = len(self.positions_list)
		pos = ratio // 100 // nb_positions
		if pos >= nb_positions:
			pos = nb_positions - 1
		return min(pos + self.item_list.start, len(self.menu_list) - 1)

	def page_jump(self, forward):
		il = self.item_list
		if forward:
			ml = self.menu_list
			pos = il.selected
			new_pos = pos + len(il)
			ml[pos:new_pos]
			return min(new_pos, len(ml) - 1)
		else:
			return max(0, il.selected - len(il))

	def do_enable_selection(self, select):
		il = self.item_list
		il[max(0, il.selected - il.start)].selected = select
		self._no_selection = not select
		if self._bar is not None:
			if select and len(self.menu_list):
				self._bar.show()
			else:
				self._bar.hide()
		return None



class Position(object):
	__slots__ = ('_x', '_y', '_move_dic', '_anim_type')
	def __init__(self, listing, x, y):
		self._x = x
		self._y = y
		if listing._centered:
			pass
		xkey, ykey = ('left', 'top')
		self._move_dic = {xkey: x, ykey: y}
		self._anim_type = listing._anim_type

	def get_kwargs(self):
		return self._move_dic

	def put(self, ui_item):
		ui_item.widget.move(**self._move_dic)

	def move(self, ui_item, duration):
		ui_item.widget.animate('move', duration=duration, step_type=self._anim_type, **self._move_dic)



class LayerPosition(Position):
	__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_layer')
	def __init__(self, listing, x, y, layer):
		Position.__init__(self, listing, x, y)
		if not isinstance(layer, int):
			print 'Invalid position (x, y, layer):',
			print x,
			print y,
			print layer
			layer = 0
		self._layer = layer

	def get_kwargs(self):
		kwargs = dict(self._move_dic)
		kwargs['layer'] = self._layer
		return kwargs

	def put(self, ui_item):
		Position.put(self, ui_item)
		ui_item.widget.set_layer(self._layer)

	def move(self, ui_item, duration):
		Position.move(self, ui_item, duration)
		ui_item.widget.set_layer(self._layer)



class SizePosition(Position):
	__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_width', '_height')
	def __init__(self, listing, x, y, width, height):
		Position.__init__(self, listing, x, y)
		self._width = width
		self._height = height

	def put(self, ui_item):
		Position.put(self, ui_item)
		ui_item.active_widget.resize(width=self._width, height=self._height)

	def move(self, ui_item, duration):
		Position.move(self, ui_item, duration)
		ui_item.active_widget.animate('size', width=self._width, height=self._height, step_type=self._anim_type, duration=duration)



class PerspectivePosition(Position):
	__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_layer', '_width', '_height')
	def __init__(self, listing, x, y, width, height, layer):
		Position.__init__(self, listing, x, y)
		if not isinstance(layer, int):
			print 'Invalid position: (x, y, width, height, layer)',
			print x,
			print y,
			print width,
			print height,
			print layer
			layer = 0
		self._layer = layer
		self._width = width
		self._height = height

	def get_kwargs(self):
		kwargs = dict(self._move_dic)
		kwargs['layer'] = self._layer
		return kwargs

	def put(self, ui_item):
		Position.put(self, ui_item)
		ui_item.active_widget.resize(width=self._width, height=self._height)
		ui_item.widget.set_layer(self._layer)

	def move(self, ui_item, duration):
		Position.move(self, ui_item, duration)
		ui_item.active_widget.animate('size', width=self._width, height=self._height, step_type=self._anim_type, duration=duration)
		ui_item.widget.set_layer(self._layer)



position_klasses = {'position': Position, 'layer': LayerPosition, 'size': SizePosition, 'perspective': PerspectivePosition}
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7502a4c>}
from __future__ import absolute_import, with_statement
__all__ = ['GenericListing']
from peewee.debug import GET_LOGGER, PRINT_EXCEPTION
from peewee.messages import send
from .items import class_item_name_dict, ItemList
from wyvas import Container, render_lock
log = GET_LOGGER(__name__)
class GenericListing(Container):
	__doc__ = '\n    Listing widget.\n    '
	_initialized = False
	_bar = None
	item_list = None
	positions_list = [('20%', '20%'), ('50%', '50%'), ('80%', '80%')]
	pre_position = None
	post_position = None
	_centered = False
	_selected = 0
	duration = 0.0
	_edited = False
	_more_items_before = None
	_more_items_after = None
	_no_selection = False
	_reversed_update = False
	_anim_type = 'linear'
	_activate_fade = True
	_cyclic = True
	update_handlers = dict(update='do_update', reset='do_reset', add='do_add', mark='do_mark', remove='do_remove', edit='do_edit', swap='do_swap', enable_selection='do_enable_selection')
	def __init__(self):
		Container.__init__(self)
		self.style_dict = dict(font_style='font=Vera font_size=18', text_color=(255, 255, 255, 255), text_size=('100%', '100%'), selected_font_style='font=Vera font_size=20', selected_text_color=(255, 255, 255, 255), selected_text_size=('100%', '100%'), unsensitive_font_style='font=Vera font_size=18', unsensitive_text_color=(255, 255, 255, 255), unsensitive_text_size=('100%', '100%'), repository='', icon_size=('100%', '100%'), selected_icon_size=('100%', '100%'), unsensitive_icon_size=('100%', '100%'), item_size=('100%', '100%'), selected_item_size=('100%', '100%'), progress_bar_background='', progress_bar_foreground='', progress_bar_offset=('0%', '0%'), progress_bar_size=('5%', '100%'), rec_icon='', rec_icon_offset=('75%', '0%'), time_offset=('5%', '0%'), time_font_style='font=Gill font_size=20 align=left', time_color=(128, 0, 64, 255), title_font_style='font=Gill font_size=20 align=left wrap=char', title_color=(128, 128, 128, 255), selected_time_font_style='font=Gill font_size=24 align=left', selected_time_color=(255, 0, 128, 255), selected_title_font_style='font=Gill font_size=24 align=left wrap=char', selected_title_color=(255, 255, 255, 255), selected_blurb_time_font_style='font=Gill font_size=24 align=left', selected_blurb_time_color=(255, 0, 128, 255), selected_blurb_title_font_style='font=Gill font_size=24 align=left wrap=char', selected_blurb_title_color=(255, 255, 255, 255), selected_blurb_text_offset=('0%', '14%'), selected_blurb_offset=('-2%', '1%'), selected_blurb_zoom='110%', selection_cursor_image='', preserve_icon_aspect=0, preserve_icon_size=0, marker_image=None, selected_marker_image=None, marker_offset=('0%', '0%'), marker_size=('100%', '10%'), centered=False, text_offset=('0%', '4%'), selected_text_offset=('0%', '14%'), enumerated=False, edit_offset=20, duration=1, opacity=255, maxlen=20, extension=('png',), autoscroll=True, page_jump='reset', pos_policy='position', fade_pre_post=True)
		return None

	def update_style(self, **kwargs):
		self.style_dict.update(kwargs)

	def set_positions(self, positions=None):
		self.positions_list = positions

	def set_selected_item(self, selected_item=0):
		self._selected = selected_item

	def set_centered(self, centered=False):
		self._centered = centered
		self.style_dict['centered'] = centered

	def set_duration(self, duration=0.0):
		self.duration = duration
		self.style_dict['duration'] = duration

	def set_bar(self, bar):
		self._bar = self.get_obj_by_name(bar)

	def set_repository(self, repository=None):
		self.repository = repository
		self.style_dict['repository'] = repository

	def set_extra_positions(self, pre_position=None, post_position=None):
		if pre_position is not None:
			self.pre_position = pre_position
		if post_position is not None:
			self.post_position = post_position
		return None

	def set_reversed_update(self, reversed_update=True):
		self._reversed_update = reversed_update

	def set_anim_type(self, anim_type='linear'):
		if anim_type in ('linear', 'log', 'exp', 'samples', 'easein', 'easeout', 'easeinout', 'bounce'):
			self._anim_type = anim_type
		else:
			log.error('Invalid anim_type (linear, log, exp, samples, easein, easeout, easeinout, bounce): %s', anim_type)

	def set_cyclic(self, cyclic=False):
		self._cyclic = cyclic

	def update(self, signal, sender, value, action=None, **kw):
		self.menu_list = value
		if action is not None:
			try:
				getattr(self, GenericListing.update_handlers[action])(**kw)
			except Exception, e:
				PRINT_EXCEPTION(e, True)
		return None

	def initialize(self, signal, sender, value, **kw):
		self.menu_list = value
		self.create_content()
		self.do_reset()
		if not self._initialized:
			_op = self.style_dict['opacity']
			self.set_color(a=_op)
			self._initialized = True

	def unparent(self):
		self.menu_list = None
		Container.unparent(self)
		return None

	def clear(self):
		self.menu_list = None
		for it in self.item_list:
			it.destroy()
		try:
			self._hidden_item.destroy()
		except:
			pass
		return None

	def do_mark(self, position=None):
		ml = self.menu_list
		if not ml or position < 0:
			pass
		il = self.item_list
		if il.start <= position:
			pass
		else:
			position
		if il.start <= position:
			il[position - il.start].marked = ml[position].is_marked()

	def do_update(self, position):
		log.error('do update NOT IMPLEMENTED')

	def do_add(self, position):
		il = self.item_list
		if il.start <= position:
			pass
		else:
			position
		if not il.start <= position:
			return self._refresh_more_items()
		new_item = self.menu_list[position]
		new_index = position - il.start
		new_comer = il[new_index]
		new_pos = self.positions_list[new_index]
		new_comer.widget.animate_stop()
		new_comer.reset(new_item, False, position=position + 1)
		self.post_position.put(new_comer)
		new_comer.fade_in()
		new_pos.move(new_comer, self.duration)

	def do_reset(self, position=None, focus=None):
		log.error('do reset NOT IMPLEMENTED')

	def do_remove(self, position):
		log.error('do remove NOT IMPLEMENTED')

	def create_content(self):
		log.error('create_content NOT IMPLEMENTED')

	def do_edit(self, edit_mode):
		il = self.item_list
		if self._edited != edit_mode:
			self._edited = edit_mode
			il[il.selected - il.start].edited = edit_mode

	def do_swap(self, i1, i2):
		log.error('do swap NOT IMPLEMENTED')

	def _create_content(self, start, style_name):
		pos_klass = position_klasses[self.style_dict['pos_policy']]

	def _scroll(self, move, duration, selected):
		if move == 0:
			return None
		il = self.item_list
		ml = self.menu_list
		pl = self.positions_list
		old_start = il.start
		old_end = il.end
		index_offset = 1
		cyclic = self._cyclic
		if abs(move) > len(il):
			new_start = old_start + move
			new_end = old_end + move
			if move > 0:
				ml = [None] * old_end + ml[new_start:new_end]
				hole_size = new_start - old_end
				move -= hole_size
				index_offset += hole_size
			else:
				ml = ml[max(0, new_start):new_end] + [None] * abs(new_start)
				hole_size = old_start - new_end
				move += hole_size
				old_start -= hole_size
				old_end -= hole_size
			cyclic = False

	def _swap_items(self, i1, i2):
		il = self.item_list
		ml = self.menu_list
		pl = self.positions_list
		nb_positions = len(pl)
		start = il.start
		item_index1 = i1 - start
		item_index2 = i2 - start
		if 0 <= item_index1:
			pass
		else:
			item_index1
		in_page1 = 0 <= item_index1
		if 0 <= item_index2:
			pass
		else:
			item_index2
		in_page2 = 0 <= item_index2
		if in_page1 ^ in_page2:
			return False
		if not(in_page1 and in_page2):
			return True
		render_lock.__enter__()
		try:
			_[1], il[item_index1], il[item_index2], selected = render_lock.__exit__, il[item_index2], il[item_index1], ml.selected
			for ui_item, pos, menu_item_idx in ((il[item_index1], pl[item_index2], i2), (il[item_index2], pl[item_index1], i1)):
				ui_item.widget.animate_stop()
				pos.move(ui_item, self.duration)
				ui_item.set_position(menu_item_idx + 1)
		finally:
			del _[1]
		return True

	def _remove_item(self, position, scroll_up):
		il = self.item_list
		ml = self.menu_list
		selected = ml.selected
		start = il.start
		end = il.end
		if start <= position:
			pass
		else:
			position
		if start <= position:
			outsider = il.pop(position - start)
			outsider.selected = False
		else:
			if scroll_up:
				if position >= end:
					return None
				outsider = il.pop(0)
				outsider_position = self.pre_position
			else:
				if position < start:
					for i, ui_item in enumerate(il):
						ui_item.set_position(start + i)
					return None
				outsider = il.pop()
				outsider_position = self.post_position
			outsider_position.move(ui_item, self.duration)
		outsider.fade_out()
		newcomer = self._hidden_item
		self._hidden_item = outsider
		newcomer.widget.animate_stop()
		if scroll_up:
			il.append(newcomer)
			if len(ml) >= end:
				pass
			new_item = None
			newcomer_position = self.post_position
		else:
			il.insert(0, newcomer)
			if start > 0:
				pass
			new_item = None
			newcomer_position = self.pre_position
		newcomer_position.put(newcomer)
		if new_item is not None:
			newcomer.reset(new_item, new_item is selected)
		else:
			newcomer.destroy()
		newcomer.fade_in()
		if scroll_up:
			pass
		idx_offset = 0
		duration = self.duration
		for i, ui_item in enumerate(zip(il, self.positions_list)):
			pos.move(ui_item, duration)
			ui_item.set_position(start + i + idx_offset)
		return None

	def _refresh_more_items(self):
		il = self.item_list
		ml = self.menu_list
		menu = ml.menu
		mib = il.start > 0
		if mib:
			if self._more_items_before is not True:
				send('%s_more_items_before' % self.name, menu)
		else:
			if self._more_items_before is not False:
				send('%s_no_more_items_before' % self.name, menu)
		self._more_items_before = mib
		mia = len(ml) > il.end
		if mia:
			if self._more_items_after is not True:
				send('%s_more_items_after' % self.name, menu)
		else:
			if self._more_items_after is not False:
				send('%s_no_more_items_after' % self.name, menu)
		self._more_items_after = mia

	def pick(self, ratio):
		nb_positions = len(self.positions_list)
		pos = ratio // 100 // nb_positions
		if pos >= nb_positions:
			pos = nb_positions - 1
		return min(pos + self.item_list.start, len(self.menu_list) - 1)

	def page_jump(self, forward):
		il = self.item_list
		if forward:
			ml = self.menu_list
			pos = il.selected
			new_pos = pos + len(il)
			ml[pos:new_pos]
			return min(new_pos, len(ml) - 1)
		else:
			return max(0, il.selected - len(il))

	def do_enable_selection(self, select):
		il = self.item_list
		il[max(0, il.selected - il.start)].selected = select
		self._no_selection = not select
		if self._bar is not None:
			if select and len(self.menu_list):
				self._bar.show()
			else:
				self._bar.hide()
		return None



class Position(object):
	__slots__ = ('_x', '_y', '_move_dic', '_anim_type')
	def __init__(self, listing, x, y):
		self._x = x
		self._y = y
		if listing._centered:
			pass
		xkey, ykey = ('left', 'top')
		self._move_dic = {xkey: x, ykey: y}
		self._anim_type = listing._anim_type

	def get_kwargs(self):
		return self._move_dic

	def put(self, ui_item):
		ui_item.widget.move(**self._move_dic)

	def move(self, ui_item, duration):
		ui_item.widget.animate('move', duration=duration, step_type=self._anim_type, **self._move_dic)



class LayerPosition(Position):
	__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_layer')
	def __init__(self, listing, x, y, layer):
		Position.__init__(self, listing, x, y)
		if not isinstance(layer, int):
			print 'Invalid position (x, y, layer):',
			print x,
			print y,
			print layer
			layer = 0
		self._layer = layer

	def get_kwargs(self):
		kwargs = dict(self._move_dic)
		kwargs['layer'] = self._layer
		return kwargs

	def put(self, ui_item):
		Position.put(self, ui_item)
		ui_item.widget.set_layer(self._layer)

	def move(self, ui_item, duration):
		Position.move(self, ui_item, duration)
		ui_item.widget.set_layer(self._layer)



class SizePosition(Position):
	__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_width', '_height')
	def __init__(self, listing, x, y, width, height):
		Position.__init__(self, listing, x, y)
		self._width = width
		self._height = height

	def put(self, ui_item):
		Position.put(self, ui_item)
		ui_item.active_widget.resize(width=self._width, height=self._height)

	def move(self, ui_item, duration):
		Position.move(self, ui_item, duration)
		ui_item.active_widget.animate('size', width=self._width, height=self._height, step_type=self._anim_type, duration=duration)



class PerspectivePosition(Position):
	__slots__ = ('_x', '_y', '_move_dic', '_anim_type', '_layer', '_width', '_height')
	def __init__(self, listing, x, y, width, height, layer):
		Position.__init__(self, listing, x, y)
		if not isinstance(layer, int):
			print 'Invalid position: (x, y, width, height, layer)',
			print x,
			print y,
			print width,
			print height,
			print layer
			layer = 0
		self._layer = layer
		self._width = width
		self._height = height

	def get_kwargs(self):
		kwargs = dict(self._move_dic)
		kwargs['layer'] = self._layer
		return kwargs

	def put(self, ui_item):
		Position.put(self, ui_item)
		ui_item.active_widget.resize(width=self._width, height=self._height)
		ui_item.widget.set_layer(self._layer)

	def move(self, ui_item, duration):
		Position.move(self, ui_item, duration)
		ui_item.active_widget.animate('size', width=self._width, height=self._height, step_type=self._anim_type, duration=duration)
		ui_item.widget.set_layer(self._layer)



position_klasses = {'position': Position, 'layer': LayerPosition, 'size': SizePosition, 'perspective': PerspectivePosition}
